blob: 780033e4e62e925721ccbaeeb477e730856f2c68 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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();
})();
|