summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/serverstatus_index_stats.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/serverstatus_index_stats.js')
-rw-r--r--jstests/noPassthrough/serverstatus_index_stats.js26
1 files changed, 22 insertions, 4 deletions
diff --git a/jstests/noPassthrough/serverstatus_index_stats.js b/jstests/noPassthrough/serverstatus_index_stats.js
index 300b71c6194..55a09653c64 100644
--- a/jstests/noPassthrough/serverstatus_index_stats.js
+++ b/jstests/noPassthrough/serverstatus_index_stats.js
@@ -26,6 +26,7 @@ const knownFeatures = [
"2dsphere",
"2dsphere_bucket",
"collation",
+ "columnstore",
"compound",
"hashed",
"id",
@@ -198,10 +199,9 @@ assertStats(db, (stats) => {
lastStats = db.serverStatus().indexStats;
-const timeSeriesMetricIndexesEnabled = db.adminCommand({
- getParameter: 1,
- featureFlagTimeseriesMetricIndexes: 1
- }).featureFlagTimeseriesMetricIndexes.value;
+const timeSeriesMetricIndexesEnabled =
+ assert.commandWorked(db.adminCommand({getParameter: 1, featureFlagTimeseriesMetricIndexes: 1}))
+ .featureFlagTimeseriesMetricIndexes.value;
if (timeSeriesMetricIndexesEnabled) {
assert.commandWorked(db.createCollection('ts', {timeseries: {timeField: 't'}}));
assert.commandWorked(db.ts.createIndex({loc: '2dsphere'}));
@@ -232,6 +232,24 @@ if (timeSeriesMetricIndexesEnabled) {
lastStats = db.serverStatus().indexStats;
+const columnstoreIndexesEnabled =
+ assert.commandWorked(db.adminCommand({getParameter: 1, featureFlagColumnstoreIndexes: 1}))
+ .featureFlagColumnstoreIndexes.value;
+if (columnstoreIndexesEnabled) {
+ // TODO SERVER-66021 should support having data.
+ // TODO SERVER-61644 (or sooner) should support accessing/using index and seeing that reflected.
+ assert.commandWorked(db.newCollection.createIndex({'$**': 'columnstore'}));
+ assertStats(db, (stats) => {
+ assertCountIncrease(lastStats, stats, 2); // Includes _id index on new collection.
+ assertFeatureCountIncrease(lastStats, stats, 'columnstore', 1);
+
+ assertFeatureAccessIncrease(lastStats, stats, 'id', 0);
+ assertFeatureAccessIncrease(lastStats, stats, 'columnstore', 0);
+ });
+}
+
+lastStats = db.serverStatus().indexStats;
+
// After restarting the server, we expect all of the access counters to reset to zero, but that the
// feature counters remain the same as before startup.
replSet.stopSet(undefined, /* restart */ true);