diff options
author | Benety Goh <benety@mongodb.com> | 2022-08-26 08:12:49 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-26 12:47:17 +0000 |
commit | eb3adbe5a061ecb3c7fb123f42241bbae03f88bd (patch) | |
tree | 28c430671c1269475db02a49ee655712069fa0df /jstests | |
parent | 26d341317559b63d21f07f25f7ff2f99373891a2 (diff) | |
download | mongo-eb3adbe5a061ecb3c7fb123f42241bbae03f88bd.tar.gz |
SERVER-64659 add indexBulkBuilder server status section with minimal creation metrics
(cherry picked from commit adc47cc974960abf0bc10a1b15234dc95ee6fdd4)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthrough/serverstatus_indexbulkbuilder.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/jstests/noPassthrough/serverstatus_indexbulkbuilder.js b/jstests/noPassthrough/serverstatus_indexbulkbuilder.js new file mode 100644 index 00000000000..780033e4e62 --- /dev/null +++ b/jstests/noPassthrough/serverstatus_indexbulkbuilder.js @@ -0,0 +1,40 @@ +/** + * Tests that serverStatus contains an indexBuilder section. This section reports + * globally-aggregated statistics about index builds and the external sorter. + * + * @tags: [ + * requires_persistence, + * requires_replication, + * ] + */ +(function() { +'use strict'; + +const replSet = new ReplSetTest({ + nodes: 1, +}); +replSet.startSet(); +replSet.initiate(); + +let primary = replSet.getPrimary(); +let testDB = primary.getDB('test'); +let coll = testDB.getCollection('t'); + +for (let i = 0; i < 10; i++) { + assert.commandWorked(coll.insert({ + _id: i, + a: i, + })); +} + +assert.commandWorked(coll.createIndex({a: 1})); + +let serverStatus = testDB.serverStatus(); +assert(serverStatus.hasOwnProperty('indexBulkBuilder'), + 'indexBuildBuilder section missing: ' + tojson(serverStatus)); + +let indexBulkBuilderSection = serverStatus.indexBulkBuilder; +assert.eq(indexBulkBuilderSection.count, 1, tojson(indexBulkBuilderSection)); + +replSet.stopSet(); +})(); |