summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r--jstests/noPassthrough/telemetry/application_name_find.js (renamed from jstests/noPassthrough/queryStats/application_name_find.js)4
-rw-r--r--jstests/noPassthrough/telemetry/clear_telemetry_store.js (renamed from jstests/noPassthrough/queryStats/clear_query_stats_store.js)23
-rw-r--r--jstests/noPassthrough/telemetry/documentSourceTelemetry_redaction_parameters.js (renamed from jstests/noPassthrough/queryStats/documentSourceQueryStats_redaction_parameters.js)28
-rw-r--r--jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js (renamed from jstests/noPassthrough/queryStats/feature_flag_off_sampling_rate_on.js)8
-rw-r--r--jstests/noPassthrough/telemetry/query_stats_key.js (renamed from jstests/noPassthrough/queryStats/query_stats_key.js)2
-rw-r--r--jstests/noPassthrough/telemetry/redact_queries_with_nonobject_fields.js (renamed from jstests/noPassthrough/queryStats/redact_queries_with_nonobject_fields.js)4
-rw-r--r--jstests/noPassthrough/telemetry/telemetry_collect_on_mongos.js (renamed from jstests/noPassthrough/queryStats/query_stats_collect_on_mongos.js)10
-rw-r--r--jstests/noPassthrough/telemetry/telemetry_feature_flag.js (renamed from jstests/noPassthrough/queryStats/query_stats_feature_flag.js)8
-rw-r--r--jstests/noPassthrough/telemetry/telemetry_metrics_across_getMore_calls.js (renamed from jstests/noPassthrough/queryStats/query_stats_metrics_across_getMore_calls.js)16
-rw-r--r--jstests/noPassthrough/telemetry/telemetry_redact_find_cmd.js (renamed from jstests/noPassthrough/queryStats/query_stats_redact_find_cmd.js)10
-rw-r--r--jstests/noPassthrough/telemetry/telemetry_sampling_rate.js (renamed from jstests/noPassthrough/queryStats/query_stats_sampling_rate.js)12
-rw-r--r--jstests/noPassthrough/telemetry/telemetry_server_status_metrics.js (renamed from jstests/noPassthrough/queryStats/query_stats_server_status_metrics.js)48
-rw-r--r--jstests/noPassthrough/telemetry/telemetry_upgrade.js (renamed from jstests/noPassthrough/queryStats/query_stats_upgrade.js)8
13 files changed, 92 insertions, 89 deletions
diff --git a/jstests/noPassthrough/queryStats/application_name_find.js b/jstests/noPassthrough/telemetry/application_name_find.js
index 36245a31514..35b86a95f53 100644
--- a/jstests/noPassthrough/queryStats/application_name_find.js
+++ b/jstests/noPassthrough/telemetry/application_name_find.js
@@ -1,6 +1,6 @@
/**
* Test that applicationName and namespace appear in telemetry for the find command.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load("jstests/libs/telemetry_utils.js");
(function() {
@@ -12,7 +12,7 @@ const kHashedFieldName = "lU7Z0mLRPRUL+RfAD5jhYPRRpXBsZBxS/20EzDwfOG4=";
// Turn on the collecting of telemetry metrics.
let options = {
- setParameter: {internalQueryStatsSamplingRate: -1},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
};
const conn = MongoRunner.runMongod(options);
diff --git a/jstests/noPassthrough/queryStats/clear_query_stats_store.js b/jstests/noPassthrough/telemetry/clear_telemetry_store.js
index 056c565ec02..b2409cc0bbb 100644
--- a/jstests/noPassthrough/queryStats/clear_query_stats_store.js
+++ b/jstests/noPassthrough/telemetry/clear_telemetry_store.js
@@ -1,6 +1,6 @@
/**
* Test that the telemetry store can be cleared when the cache size is reset to 0.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load("jstests/libs/telemetry_utils.js"); // For verifyMetrics.
@@ -9,8 +9,10 @@ load("jstests/libs/telemetry_utils.js"); // For verifyMetrics.
// Turn on the collecting of telemetry metrics.
let options = {
- setParameter:
- {internalQueryStatsSamplingRate: -1, internalQueryConfigureQueryStatsCacheSize: "10MB"},
+ setParameter: {
+ internalQueryConfigureTelemetrySamplingRate: -1,
+ internalQueryConfigureTelemetryCacheSize: "10MB"
+ },
};
const conn = MongoRunner.runMongod(options);
@@ -27,19 +29,18 @@ for (var j = 0; j < 10; ++j) {
}
// Confirm number of entries in the store and that none have been evicted.
-let telemetryResults = testDB.getSiblingDB("admin").aggregate([{$queryStats: {}}]).toArray();
+let telemetryResults = testDB.getSiblingDB("admin").aggregate([{$telemetry: {}}]).toArray();
assert.eq(telemetryResults.length, 10, telemetryResults);
-assert.eq(testDB.serverStatus().metrics.queryStats.numEvicted, 0);
+assert.eq(testDB.serverStatus().metrics.telemetry.numEvicted, 0);
// Command to clear the cache.
assert.commandWorked(
- testDB.adminCommand({setParameter: 1, internalQueryConfigureQueryStatsCacheSize: "0MB"}));
+ testDB.adminCommand({setParameter: 1, internalQueryConfigureTelemetryCacheSize: "0MB"}));
-// 10 regular queries plus the $queryStats query, means 11 entries evicted when the cache is
-// cleared.
-assert.eq(testDB.serverStatus().metrics.queryStats.numEvicted, 11);
+// 10 regular queries plus the $telemetry query, means 11 entries evicted when the cache is cleared.
+assert.eq(testDB.serverStatus().metrics.telemetry.numEvicted, 11);
-// Calling $queryStats should fail when the telemetry store size is 0 bytes.
-assert.throwsWithCode(() => testDB.getSiblingDB("admin").aggregate([{$queryStats: {}}]), 6579000);
+// Calling $telemetry should fail when the telemetry store size is 0 bytes.
+assert.throwsWithCode(() => testDB.getSiblingDB("admin").aggregate([{$telemetry: {}}]), 6579000);
MongoRunner.stopMongod(conn);
}());
diff --git a/jstests/noPassthrough/queryStats/documentSourceQueryStats_redaction_parameters.js b/jstests/noPassthrough/telemetry/documentSourceTelemetry_redaction_parameters.js
index 8facb106072..c4f785abf6a 100644
--- a/jstests/noPassthrough/queryStats/documentSourceQueryStats_redaction_parameters.js
+++ b/jstests/noPassthrough/telemetry/documentSourceTelemetry_redaction_parameters.js
@@ -1,6 +1,6 @@
/**
- * Test the $queryStats hmac properties.
- * @tags: [featureFlagQueryStats]
+ * Test the $telemetry hmac properties.
+ * @tags: [featureFlagTelemetry]
*/
load("jstests/aggregation/extras/utils.js"); // For assertAdminDBErrCodeAndErrMsgContains.
@@ -42,41 +42,41 @@ function runTest(conn) {
assertTelemetryKeyWithoutHmac(getTelemetryRedacted(conn, false)[0]["key"].queryShape);
// Wrong parameter name throws error.
- let pipeline = [{$queryStats: {redactFields: true}}];
+ let pipeline = [{$telemetry: {redactFields: true}}];
assertAdminDBErrCodeAndErrMsgContains(
coll,
pipeline,
ErrorCodes.FailedToParse,
- "$queryStats parameters object may only contain 'applyHmacToIdentifiers' or 'hmacKey' options. Found: redactFields");
+ "$telemetry parameters object may only contain 'applyHmacToIdentifiers' or 'hmacKey' options. Found: redactFields");
// Wrong parameter type throws error.
- pipeline = [{$queryStats: {applyHmacToIdentifiers: 1}}];
+ pipeline = [{$telemetry: {applyHmacToIdentifiers: 1}}];
assertAdminDBErrCodeAndErrMsgContains(
coll,
pipeline,
ErrorCodes.FailedToParse,
- "$queryStats applyHmacToIdentifiers parameter must be boolean. Found type: double");
+ "$telemetry applyHmacToIdentifiers parameter must be boolean. Found type: double");
- pipeline = [{$queryStats: {hmacKey: 1}}];
+ pipeline = [{$telemetry: {hmacKey: 1}}];
assertAdminDBErrCodeAndErrMsgContains(
coll,
pipeline,
ErrorCodes.FailedToParse,
- "$queryStats hmacKey parameter must be bindata of length 32 or greater. Found type: double");
+ "$telemetry hmacKey parameter must be bindata of length 32 or greater. Found type: double");
// Parameter object with unrecognized key throws error.
- pipeline = [{$queryStats: {applyHmacToIdentifiers: true, hmacStrategy: "on"}}];
+ pipeline = [{$telemetry: {applyHmacToIdentifiers: true, hmacStrategy: "on"}}];
assertAdminDBErrCodeAndErrMsgContains(
coll,
pipeline,
ErrorCodes.FailedToParse,
- "$queryStats parameters object may only contain 'applyHmacToIdentifiers' or 'hmacKey' options. Found: hmacStrategy");
+ "$telemetry parameters object may only contain 'applyHmacToIdentifiers' or 'hmacKey' options. Found: hmacStrategy");
}
const conn = MongoRunner.runMongod({
setParameter: {
- internalQueryStatsSamplingRate: -1,
- featureFlagQueryStats: true,
+ internalQueryConfigureTelemetrySamplingRate: -1,
+ featureFlagTelemetry: true,
}
});
runTest(conn);
@@ -89,8 +89,8 @@ const st = new ShardingTest({
rs: {nodes: 1},
mongosOptions: {
setParameter: {
- internalQueryStatsSamplingRate: -1,
- featureFlagQueryStats: true,
+ internalQueryConfigureTelemetrySamplingRate: -1,
+ featureFlagTelemetry: true,
'failpoint.skipClusterParameterRefresh': "{'mode':'alwaysOn'}"
}
},
diff --git a/jstests/noPassthrough/queryStats/feature_flag_off_sampling_rate_on.js b/jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js
index 38474b944d0..7fbc079cc7b 100644
--- a/jstests/noPassthrough/queryStats/feature_flag_off_sampling_rate_on.js
+++ b/jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js
@@ -10,14 +10,14 @@ load("jstests/libs/feature_flag_util.js");
// Set sampling rate to -1.
let options = {
- setParameter: {internalQueryStatsSamplingRate: -1},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
};
const conn = MongoRunner.runMongod(options);
const testdb = conn.getDB('test');
// This test specifically tests error handling when the feature flag is not on.
// TODO SERVER-65800 This test can be deleted when the feature is on by default.
-if (!conn || FeatureFlagUtil.isEnabled(testdb, "QueryStats")) {
+if (!conn || FeatureFlagUtil.isEnabled(testdb, "Telemetry")) {
jsTestLog(`Skipping test since feature flag is disabled. conn: ${conn}`);
if (conn) {
MongoRunner.stopMongod(conn);
@@ -38,14 +38,14 @@ assert.commandWorked(bulk.execute());
// Pipeline to read telemetry store should fail without feature flag turned on even though sampling
// rate is > 0.
assert.commandFailedWithCode(
- testdb.adminCommand({aggregate: 1, pipeline: [{$queryStats: {}}], cursor: {}}),
+ testdb.adminCommand({aggregate: 1, pipeline: [{$telemetry: {}}], cursor: {}}),
ErrorCodes.QueryFeatureNotAllowed);
// Pipeline, with a filter, to read telemetry store fails without feature flag turned on even though
// sampling rate is > 0.
assert.commandFailedWithCode(testdb.adminCommand({
aggregate: 1,
- pipeline: [{$queryStats: {}}, {$match: {"key.queryShape.find": {$eq: "###"}}}],
+ pipeline: [{$telemetry: {}}, {$match: {"key.queryShape.find": {$eq: "###"}}}],
cursor: {}
}),
ErrorCodes.QueryFeatureNotAllowed);
diff --git a/jstests/noPassthrough/queryStats/query_stats_key.js b/jstests/noPassthrough/telemetry/query_stats_key.js
index 8b63417078a..68d77110bc6 100644
--- a/jstests/noPassthrough/queryStats/query_stats_key.js
+++ b/jstests/noPassthrough/telemetry/query_stats_key.js
@@ -64,7 +64,7 @@ function confirmAllFieldsPresent(queryStatsEntries) {
// Turn on the collecting of telemetry metrics.
let options = {
- setParameter: {internalQueryStatsSamplingRate: -1},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
};
const conn = MongoRunner.runMongod(options);
diff --git a/jstests/noPassthrough/queryStats/redact_queries_with_nonobject_fields.js b/jstests/noPassthrough/telemetry/redact_queries_with_nonobject_fields.js
index 7528ab9a4ab..25cac47555e 100644
--- a/jstests/noPassthrough/queryStats/redact_queries_with_nonobject_fields.js
+++ b/jstests/noPassthrough/telemetry/redact_queries_with_nonobject_fields.js
@@ -1,6 +1,6 @@
/**
* Test that telemetry key generation works for queries with non-object fields.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load('jstests/libs/analyze_plan.js');
@@ -9,7 +9,7 @@ load('jstests/libs/analyze_plan.js');
// Turn on the collecting of telemetry metrics.
let options = {
- setParameter: {internalQueryStatsSamplingRate: -1},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
};
const conn = MongoRunner.runMongod(options);
diff --git a/jstests/noPassthrough/queryStats/query_stats_collect_on_mongos.js b/jstests/noPassthrough/telemetry/telemetry_collect_on_mongos.js
index 97057269527..ff9fadc85c7 100644
--- a/jstests/noPassthrough/queryStats/query_stats_collect_on_mongos.js
+++ b/jstests/noPassthrough/telemetry/telemetry_collect_on_mongos.js
@@ -1,6 +1,6 @@
/**
* Test that mongos is collecting telemetry metrics.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load('jstests/libs/telemetry_utils.js');
@@ -18,7 +18,7 @@ const setup = () => {
rs: {nodes: 1},
mongosOptions: {
setParameter: {
- internalQueryStatsSamplingRate: -1,
+ internalQueryConfigureTelemetrySamplingRate: -1,
'failpoint.skipClusterParameterRefresh': "{'mode':'alwaysOn'}"
}
},
@@ -95,8 +95,7 @@ const assertExpectedResults = (results,
collection: coll.getName(),
batchSize: 2
})); // returns 1 doc, exhausts the cursor
- // The $queryStats query for the previous `getTelemetry` is included in this call to
- // $queryStats.
+ // The $telemetry query for the previous `getTelemetry` is included in this call to $telemetry.
telemetry = getTelemetry(db);
assert.eq(2, telemetry.length, telemetry);
assertExpectedResults(telemetry[0],
@@ -160,8 +159,7 @@ const assertExpectedResults = (results,
collection: coll.getName(),
batchSize: 2
})); // returns 1 doc, exhausts the cursor
- // The $queryStats query for the previous `getTelemetry` is included in this call to
- // $queryStats.
+ // The $telemetry query for the previous `getTelemetry` is included in this call to $telemetry.
telemetry = getTelemetry(db);
assert.eq(2, telemetry.length, telemetry);
assertExpectedResults(telemetry[0],
diff --git a/jstests/noPassthrough/queryStats/query_stats_feature_flag.js b/jstests/noPassthrough/telemetry/telemetry_feature_flag.js
index bcce489d8da..4071b732796 100644
--- a/jstests/noPassthrough/queryStats/query_stats_feature_flag.js
+++ b/jstests/noPassthrough/telemetry/telemetry_feature_flag.js
@@ -11,21 +11,21 @@ load("jstests/libs/feature_flag_util.js");
// TODO SERVER-65800 this test can be removed when the feature flag is removed.
const conn = MongoRunner.runMongod();
const testDB = conn.getDB('test');
-if (FeatureFlagUtil.isEnabled(testDB, "QueryStats")) {
- jsTestLog("Skipping test since query stats are enabled.");
+if (FeatureFlagUtil.isEnabled(testDB, "Telemetry")) {
+ jsTestLog("Skipping test since telemetry is enabled.");
MongoRunner.stopMongod(conn);
return;
}
// Pipeline to read telemetry store should fail without feature flag turned on.
assert.commandFailedWithCode(
- testDB.adminCommand({aggregate: 1, pipeline: [{$queryStats: {}}], cursor: {}}),
+ testDB.adminCommand({aggregate: 1, pipeline: [{$telemetry: {}}], cursor: {}}),
ErrorCodes.QueryFeatureNotAllowed);
// Pipeline, with a filter, to read telemetry store fails without feature flag turned on.
assert.commandFailedWithCode(testDB.adminCommand({
aggregate: 1,
- pipeline: [{$queryStats: {}}, {$match: {"key.queryShape.find": {$eq: "###"}}}],
+ pipeline: [{$telemetry: {}}, {$match: {"key.queryShape.find": {$eq: "###"}}}],
cursor: {}
}),
ErrorCodes.QueryFeatureNotAllowed);
diff --git a/jstests/noPassthrough/queryStats/query_stats_metrics_across_getMore_calls.js b/jstests/noPassthrough/telemetry/telemetry_metrics_across_getMore_calls.js
index d5caea74cf7..91605c5e069 100644
--- a/jstests/noPassthrough/queryStats/query_stats_metrics_across_getMore_calls.js
+++ b/jstests/noPassthrough/telemetry/telemetry_metrics_across_getMore_calls.js
@@ -1,7 +1,7 @@
/**
* Test that the telemetry metrics are aggregated properly by distinct query shape over getMore
* calls.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load("jstests/libs/telemetry_utils.js"); // For verifyMetrics.
@@ -10,7 +10,7 @@ load("jstests/libs/telemetry_utils.js"); // For verifyMetrics.
// Turn on the collecting of telemetry metrics.
let options = {
- setParameter: {internalQueryStatsSamplingRate: -1},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
};
const conn = MongoRunner.runMongod(options);
@@ -35,7 +35,7 @@ assert.commandWorked(bulk.execute());
coll.aggregate([{$match: {foo: 0}}], {cursor: {batchSize: 2}}).toArray();
// This command will return all telemetry store entires.
- const telemetryResults = testDB.getSiblingDB("admin").aggregate([{$queryStats: {}}]).toArray();
+ const telemetryResults = testDB.getSiblingDB("admin").aggregate([{$telemetry: {}}]).toArray();
// Assert there is only one entry.
assert.eq(telemetryResults.length, 1, telemetryResults);
const telemetryEntry = telemetryResults[0];
@@ -71,7 +71,7 @@ const fooNeBatchSize = 3;
// This filters telemetry entires to just the ones entered when running above find queries.
const telemetryResults = testDB.getSiblingDB("admin")
.aggregate([
- {$queryStats: {}},
+ {$telemetry: {}},
{$match: {"key.queryShape.filter.foo": {$exists: true}}},
{$sort: {key: 1}},
])
@@ -102,7 +102,7 @@ const fooNeBatchSize = 3;
// This filters telemetry entires to just the ones entered when running above find queries.
let telemetryResults =
testDB.getSiblingDB("admin")
- .aggregate([{$queryStats: {}}, {$match: {"key.queryShape.command": "find"}}])
+ .aggregate([{$telemetry: {}}, {$match: {"key.queryShape.command": "find"}}])
.toArray();
assert.eq(telemetryResults.length, 4, telemetryResults);
@@ -110,7 +110,7 @@ const fooNeBatchSize = 3;
// This filters to just the telemetry for query coll.find().sort({"foo": 1}).batchSize(2).
telemetryResults = testDB.getSiblingDB("admin")
- .aggregate([{$queryStats: {}}, {$match: {"key.queryShape.sort.foo": 1}}])
+ .aggregate([{$telemetry: {}}, {$match: {"key.queryShape.sort.foo": 1}}])
.toArray();
assert.eq(telemetryResults.length, 1, telemetryResults);
assert.eq(telemetryResults[0].key.queryShape.cmdNs.db, "test");
@@ -123,7 +123,7 @@ const fooNeBatchSize = 3;
// 1}}).limit(query2Limit).batchSize(2).
telemetryResults =
testDB.getSiblingDB("admin")
- .aggregate([{$queryStats: {}}, {$match: {"key.queryShape.limit": '?number'}}])
+ .aggregate([{$telemetry: {}}, {$match: {"key.queryShape.limit": '?number'}}])
.toArray();
assert.eq(telemetryResults.length, 1, telemetryResults);
assert.eq(telemetryResults[0].key.queryShape.cmdNs.db, "test");
@@ -135,7 +135,7 @@ const fooNeBatchSize = 3;
// This filters to just the telemetry for query coll.find({foo: {$eq: 0}}).batchSize(2).
telemetryResults = testDB.getSiblingDB("admin")
.aggregate([
- {$queryStats: {}},
+ {$telemetry: {}},
{
$match: {
"key.queryShape.filter.foo": {$eq: {$eq: "?number"}},
diff --git a/jstests/noPassthrough/queryStats/query_stats_redact_find_cmd.js b/jstests/noPassthrough/telemetry/telemetry_redact_find_cmd.js
index b2cce48cdb7..54b909adae9 100644
--- a/jstests/noPassthrough/queryStats/query_stats_redact_find_cmd.js
+++ b/jstests/noPassthrough/telemetry/telemetry_redact_find_cmd.js
@@ -1,5 +1,5 @@
/**
- * Test that $queryStats properly applies hmac to find commands, on mongod and mongos.
+ * Test that $telemetry properly applies hmac to find commands, on mongod and mongos.
*/
load("jstests/libs/telemetry_utils.js");
(function() {
@@ -44,8 +44,8 @@ function runTest(conn) {
const conn = MongoRunner.runMongod({
setParameter: {
- internalQueryStatsSamplingRate: -1,
- featureFlagQueryStats: true,
+ internalQueryConfigureTelemetrySamplingRate: -1,
+ featureFlagTelemetry: true,
}
});
runTest(conn);
@@ -58,8 +58,8 @@ const st = new ShardingTest({
rs: {nodes: 1},
mongosOptions: {
setParameter: {
- internalQueryStatsSamplingRate: -1,
- featureFlagQueryStats: true,
+ internalQueryConfigureTelemetrySamplingRate: -1,
+ featureFlagTelemetry: true,
'failpoint.skipClusterParameterRefresh': "{'mode':'alwaysOn'}"
}
},
diff --git a/jstests/noPassthrough/queryStats/query_stats_sampling_rate.js b/jstests/noPassthrough/telemetry/telemetry_sampling_rate.js
index 009c59737fa..1bada398a03 100644
--- a/jstests/noPassthrough/queryStats/query_stats_sampling_rate.js
+++ b/jstests/noPassthrough/telemetry/telemetry_sampling_rate.js
@@ -1,7 +1,7 @@
/**
* Test that calls to read from telemetry store fail when sampling rate is not greater than 0 even
* if feature flag is on.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load('jstests/libs/analyze_plan.js');
@@ -9,7 +9,7 @@ load('jstests/libs/analyze_plan.js');
"use strict";
let options = {
- setParameter: {internalQueryStatsSamplingRate: 0},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: 0},
};
const conn = MongoRunner.runMongod(options);
@@ -23,15 +23,15 @@ for (var i = 0; i < 20; i++) {
coll.aggregate([{$match: {foo: 1}}], {cursor: {batchSize: 2}});
// Reading telemetry store with a sampling rate of 0 should return 0 documents.
-let telStore = testdb.adminCommand({aggregate: 1, pipeline: [{$queryStats: {}}], cursor: {}});
+let telStore = testdb.adminCommand({aggregate: 1, pipeline: [{$telemetry: {}}], cursor: {}});
assert.eq(telStore.cursor.firstBatch.length, 0);
// Reading telemetry store should work now with a sampling rate of greater than 0.
-assert.commandWorked(
- testdb.adminCommand({setParameter: 1, internalQueryStatsSamplingRate: 2147483647}));
+assert.commandWorked(testdb.adminCommand(
+ {setParameter: 1, internalQueryConfigureTelemetrySamplingRate: 2147483647}));
coll.aggregate([{$match: {foo: 1}}], {cursor: {batchSize: 2}});
telStore = assert.commandWorked(
- testdb.adminCommand({aggregate: 1, pipeline: [{$queryStats: {}}], cursor: {}}));
+ testdb.adminCommand({aggregate: 1, pipeline: [{$telemetry: {}}], cursor: {}}));
assert.eq(telStore.cursor.firstBatch.length, 1);
MongoRunner.stopMongod(conn);
diff --git a/jstests/noPassthrough/queryStats/query_stats_server_status_metrics.js b/jstests/noPassthrough/telemetry/telemetry_server_status_metrics.js
index b142d901a7f..2235d272a9f 100644
--- a/jstests/noPassthrough/queryStats/query_stats_server_status_metrics.js
+++ b/jstests/noPassthrough/telemetry/telemetry_server_status_metrics.js
@@ -1,6 +1,6 @@
/**
* Test the telemetry related serverStatus metrics.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load('jstests/libs/analyze_plan.js');
@@ -23,7 +23,7 @@ function runTestWithMongodOptions(mongodOptions, test, testOptions) {
* testOptions must include `resetCacheSize` bool field; e.g., { resetCacheSize : true }
*/
function evictionTest(conn, testDB, coll, testOptions) {
- const evictedBefore = testDB.serverStatus().metrics.queryStats.numEvicted;
+ const evictedBefore = testDB.serverStatus().metrics.telemetry.numEvicted;
assert.eq(evictedBefore, 0);
for (var i = 0; i < 4000; i++) {
let query = {};
@@ -31,16 +31,16 @@ function evictionTest(conn, testDB, coll, testOptions) {
coll.aggregate([{$match: query}]).itcount();
}
if (!testOptions.resetCacheSize) {
- const evictedAfter = testDB.serverStatus().metrics.queryStats.numEvicted;
+ const evictedAfter = testDB.serverStatus().metrics.telemetry.numEvicted;
assert.gt(evictedAfter, 0);
return;
}
// Make sure number of evicted entries increases when the cache size is reset, which forces out
// least recently used entries to meet the new, smaller size requirement.
- assert.eq(testDB.serverStatus().metrics.queryStats.numEvicted, 0);
+ assert.eq(testDB.serverStatus().metrics.telemetry.numEvicted, 0);
assert.commandWorked(
- testDB.adminCommand({setParameter: 1, internalQueryConfigureQueryStatsCacheSize: "1MB"}));
- const evictedAfter = testDB.serverStatus().metrics.queryStats.numEvicted;
+ testDB.adminCommand({setParameter: 1, internalQueryConfigureTelemetryCacheSize: "1MB"}));
+ const evictedAfter = testDB.serverStatus().metrics.telemetry.numEvicted;
assert.gt(evictedAfter, 0);
}
@@ -53,7 +53,7 @@ function evictionTest(conn, testDB, coll, testOptions) {
*/
function countRateLimitedRequestsTest(conn, testDB, coll, testOptions) {
const numRateLimitedRequestsBefore =
- testDB.serverStatus().metrics.queryStats.numRateLimitedRequests;
+ testDB.serverStatus().metrics.telemetry.numRateLimitedRequests;
assert.eq(numRateLimitedRequestsBefore, 0);
coll.insert({a: 0});
@@ -65,7 +65,7 @@ function countRateLimitedRequestsTest(conn, testDB, coll, testOptions) {
}
const numRateLimitedRequestsAfter =
- testDB.serverStatus().metrics.queryStats.numRateLimitedRequests;
+ testDB.serverStatus().metrics.telemetry.numRateLimitedRequests;
if (testOptions.samplingRate === 0) {
// Telemetry should not be collected for any requests.
@@ -81,7 +81,7 @@ function countRateLimitedRequestsTest(conn, testDB, coll, testOptions) {
}
function telemetryStoreSizeEstimateTest(conn, testDB, coll, testOptions) {
- assert.eq(testDB.serverStatus().metrics.queryStats.queryStatsStoreSizeEstimateBytes, 0);
+ assert.eq(testDB.serverStatus().metrics.telemetry.telemetryStoreSizeEstimateBytes, 0);
let halfWayPointSize;
// Only using three digit numbers (eg 100, 101) means the string length will be the same for all
// entries and therefore the key size will be the same for all entries, which makes predicting
@@ -90,12 +90,12 @@ function telemetryStoreSizeEstimateTest(conn, testDB, coll, testOptions) {
coll.aggregate([{$match: {["foo" + i]: "bar"}}]).itcount();
if (i == 150) {
halfWayPointSize =
- testDB.serverStatus().metrics.queryStats.queryStatsStoreSizeEstimateBytes;
+ testDB.serverStatus().metrics.telemetry.telemetryStoreSizeEstimateBytes;
}
}
// Confirm that telemetry store has grown and size is non-zero.
assert.gt(halfWayPointSize, 0);
- const fullSize = testDB.serverStatus().metrics.queryStats.queryStatsStoreSizeEstimateBytes;
+ const fullSize = testDB.serverStatus().metrics.telemetry.telemetryStoreSizeEstimateBytes;
assert.gt(fullSize, 0);
// Make sure the final telemetry store size is twice as much as the halfway point size (+/- 5%)
assert(fullSize >= halfWayPointSize * 1.95 && fullSize <= halfWayPointSize * 2.05,
@@ -109,7 +109,7 @@ function telemetryStoreWriteErrorsTest(conn, testDB, coll, testOptions) {
return;
}
- const errorsBefore = testDB.serverStatus().metrics.queryStats.numQueryStatsStoreWriteErrors;
+ const errorsBefore = testDB.serverStatus().metrics.telemetry.numTelemetryStoreWriteErrors;
assert.eq(errorsBefore, 0);
for (let i = 0; i < 5; i++) {
// Command should succeed and record the error.
@@ -121,7 +121,7 @@ function telemetryStoreWriteErrorsTest(conn, testDB, coll, testOptions) {
// Make sure that we recorded a write error for each run.
// TODO SERVER-73152 we attempt to write to the telemetry store twice for each aggregate, which
// seems wrong.
- assert.eq(testDB.serverStatus().metrics.queryStats.numQueryStatsStoreWriteErrors, 10);
+ assert.eq(testDB.serverStatus().metrics.telemetry.numTelemetryStoreWriteErrors, 10);
}
/**
@@ -129,8 +129,10 @@ function telemetryStoreWriteErrorsTest(conn, testDB, coll, testOptions) {
* eviction.
*/
runTestWithMongodOptions({
- setParameter:
- {internalQueryConfigureQueryStatsCacheSize: "1MB", internalQueryStatsSamplingRate: -1},
+ setParameter: {
+ internalQueryConfigureTelemetryCacheSize: "1MB",
+ internalQueryConfigureTelemetrySamplingRate: -1
+ },
},
evictionTest,
{resetCacheSize: false});
@@ -138,8 +140,10 @@ runTestWithMongodOptions({
* In this configuration, eviction is triggered only when the telemetry store size is reset.
* */
runTestWithMongodOptions({
- setParameter:
- {internalQueryConfigureQueryStatsCacheSize: "4MB", internalQueryStatsSamplingRate: -1},
+ setParameter: {
+ internalQueryConfigureTelemetryCacheSize: "4MB",
+ internalQueryConfigureTelemetrySamplingRate: -1
+ },
},
evictionTest,
{resetCacheSize: true});
@@ -148,7 +152,7 @@ runTestWithMongodOptions({
* In this configuration, every query is sampled, so no requests should be rate-limited.
*/
runTestWithMongodOptions({
- setParameter: {internalQueryStatsSamplingRate: -1},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
},
countRateLimitedRequestsTest,
{samplingRate: 2147483647, numRequests: 20});
@@ -158,7 +162,7 @@ runTestWithMongodOptions({
* rate-limited.
*/
runTestWithMongodOptions({
- setParameter: {internalQueryStatsSamplingRate: 10},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: 10},
},
countRateLimitedRequestsTest,
{samplingRate: 10, numRequests: 20});
@@ -168,7 +172,7 @@ runTestWithMongodOptions({
* size
*/
runTestWithMongodOptions({
- setParameter: {internalQueryStatsSamplingRate: -1},
+ setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
},
telemetryStoreSizeEstimateTest);
@@ -178,8 +182,8 @@ runTestWithMongodOptions({
*/
runTestWithMongodOptions({
setParameter: {
- internalQueryConfigureQueryStatsCacheSize: "0.00001MB",
- internalQueryStatsSamplingRate: -1
+ internalQueryConfigureTelemetryCacheSize: "0.00001MB",
+ internalQueryConfigureTelemetrySamplingRate: -1
},
},
telemetryStoreWriteErrorsTest);
diff --git a/jstests/noPassthrough/queryStats/query_stats_upgrade.js b/jstests/noPassthrough/telemetry/telemetry_upgrade.js
index 919d9f87baf..f396d23b948 100644
--- a/jstests/noPassthrough/queryStats/query_stats_upgrade.js
+++ b/jstests/noPassthrough/telemetry/telemetry_upgrade.js
@@ -1,6 +1,6 @@
/**
* Test that telemetry doesn't work on a lower FCV version but works after an FCV upgrade.
- * @tags: [featureFlagQueryStats]
+ * @tags: [featureFlagTelemetry]
*/
load('jstests/libs/analyze_plan.js');
load("jstests/libs/feature_flag_util.js");
@@ -12,7 +12,7 @@ const dbpath = MongoRunner.dataPath + jsTestName();
let conn = MongoRunner.runMongod({dbpath: dbpath});
let testDB = conn.getDB(jsTestName());
// This test should only be run with the flag enabled.
-assert(FeatureFlagUtil.isEnabled(testDB, "QueryStats"));
+assert(FeatureFlagUtil.isEnabled(testDB, "Telemetry"));
function testLower(restart = false) {
let adminDB = conn.getDB("admin");
@@ -26,7 +26,7 @@ function testLower(restart = false) {
}
assert.commandFailedWithCode(
- testDB.adminCommand({aggregate: 1, pipeline: [{$queryStats: {}}], cursor: {}}), 6579000);
+ testDB.adminCommand({aggregate: 1, pipeline: [{$telemetry: {}}], cursor: {}}), 6579000);
// Upgrade FCV.
assert.commandWorked(adminDB.runCommand(
@@ -34,7 +34,7 @@ function testLower(restart = false) {
// We should be able to run a telemetry pipeline now that the FCV is correct.
assert.commandWorked(
- testDB.adminCommand({aggregate: 1, pipeline: [{$queryStats: {}}], cursor: {}}),
+ testDB.adminCommand({aggregate: 1, pipeline: [{$telemetry: {}}], cursor: {}}),
);
}
testLower(true);