var st = new ShardingTest({shards: 1});
|
var coll = st.getDB("test").getCollection("foo");
|
var ret = coll.getDB().adminCommand("serverStatus");
|
assert.commandWorked(ret);
|
var commandCounters = ret.opcounters.command;
|
var insertCounters = ret.opcounters.insert;
|
assert.commandWorked(coll.runCommand("insert", {documents: [{}]}));
|
ret = coll.getDB().adminCommand("serverStatus");
|
assert.commandWorked(ret);
|
assert.eq(ret.opcounters.insert, insertCounters + 1); // "insert" command counts as 1 insert
|
assert.eq(ret.opcounters.command, commandCounters + 1); // "serverStatus" command counts as 1 command
|
st.stop();
|