summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/telemetry/clear_telemetry_store.js
diff options
context:
space:
mode:
authorWill Buerger <will.buerger@mongodb.com>2023-05-17 11:49:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-17 12:58:52 +0000
commitae65ecae5514adc99d60b7396137a1acf2b44335 (patch)
tree24169f9a640321bfbbec649e869fe51b273b35e3 /jstests/noPassthrough/telemetry/clear_telemetry_store.js
parent1b4a551a6b8c85611e26857217ce1a1e1363e716 (diff)
downloadmongo-ae65ecae5514adc99d60b7396137a1acf2b44335.tar.gz
SERVER-76427 Rename $telemetry to $queryStats
Diffstat (limited to 'jstests/noPassthrough/telemetry/clear_telemetry_store.js')
-rw-r--r--jstests/noPassthrough/telemetry/clear_telemetry_store.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/jstests/noPassthrough/telemetry/clear_telemetry_store.js b/jstests/noPassthrough/telemetry/clear_telemetry_store.js
deleted file mode 100644
index b2409cc0bbb..00000000000
--- a/jstests/noPassthrough/telemetry/clear_telemetry_store.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Test that the telemetry store can be cleared when the cache size is reset to 0.
- * @tags: [featureFlagTelemetry]
- */
-load("jstests/libs/telemetry_utils.js"); // For verifyMetrics.
-
-(function() {
-"use strict";
-
-// Turn on the collecting of telemetry metrics.
-let options = {
- setParameter: {
- internalQueryConfigureTelemetrySamplingRate: -1,
- internalQueryConfigureTelemetryCacheSize: "10MB"
- },
-};
-
-const conn = MongoRunner.runMongod(options);
-const testDB = conn.getDB('test');
-var coll = testDB[jsTestName()];
-coll.drop();
-
-let query = {};
-for (var j = 0; j < 10; ++j) {
- query["foo.field.xyz." + j] = 1;
- query["bar.field.xyz." + j] = 2;
- query["baz.field.xyz." + j] = 3;
- coll.aggregate([{$match: query}]).itcount();
-}
-
-// Confirm number of entries in the store and that none have been evicted.
-let telemetryResults = testDB.getSiblingDB("admin").aggregate([{$telemetry: {}}]).toArray();
-assert.eq(telemetryResults.length, 10, telemetryResults);
-assert.eq(testDB.serverStatus().metrics.telemetry.numEvicted, 0);
-
-// Command to clear the cache.
-assert.commandWorked(
- testDB.adminCommand({setParameter: 1, internalQueryConfigureTelemetryCacheSize: "0MB"}));
-
-// 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 $telemetry should fail when the telemetry store size is 0 bytes.
-assert.throwsWithCode(() => testDB.getSiblingDB("admin").aggregate([{$telemetry: {}}]), 6579000);
-MongoRunner.stopMongod(conn);
-}());