summaryrefslogtreecommitdiff
path: root/jstests/core/opcounters_write_cmd.js
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2015-07-09 16:56:10 -0400
committerDavid Storch <david.storch@10gen.com>2015-07-09 17:04:35 -0400
commit3a1a4466e0e9a6a9532761fc5e13e2fac75b5b73 (patch)
treec30d8c97dcb8eafdb5a97432db2670effa422166 /jstests/core/opcounters_write_cmd.js
parent9c97272957073d9643d7ce0eb02222e4c6884dd0 (diff)
downloadmongo-3a1a4466e0e9a6a9532761fc5e13e2fac75b5b73.tar.gz
SERVER-18770 SERVER-18768 fix opcounters_write_cmd.js
Diffstat (limited to 'jstests/core/opcounters_write_cmd.js')
-rw-r--r--jstests/core/opcounters_write_cmd.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/jstests/core/opcounters_write_cmd.js b/jstests/core/opcounters_write_cmd.js
index 6296582694c..4fd1c4ed34b 100644
--- a/jstests/core/opcounters_write_cmd.js
+++ b/jstests/core/opcounters_write_cmd.js
@@ -6,7 +6,6 @@ var mongo = new Mongo(db.getMongo().host);
var newdb = mongo.getDB(db.toString());
var t = newdb.opcounters;
-var isMongos = ("isdbgrid" == newdb.runCommand("ismaster").msg);
var opCounters;
var res;
@@ -101,8 +100,7 @@ assert.eq(opCounters.delete + 1, newdb.serverStatus().opcounters.delete);
//
// 4. Query.
//
-// - mongod: counted as 1 op, regardless of errors
-// - mongos: counted as 1 op if successful, else 0
+// - counted as 1 op, regardless of errors
//
t.drop();
@@ -116,7 +114,7 @@ assert.eq(opCounters.query + 1, newdb.serverStatus().opcounters.query);
// Query, with error.
opCounters = newdb.serverStatus().opcounters;
assert.throws(function() { t.findOne({_id:{$invalidOp:1}}) });
-assert.eq(opCounters.query + (isMongos ? 0 : 1), newdb.serverStatus().opcounters.query);
+assert.eq(opCounters.query + 1, newdb.serverStatus().opcounters.query);
//
// 5. Getmore.
@@ -177,8 +175,8 @@ assert.eq(countVal.failed + 1,
"failed count command counter did not increment"); // "serverStatus", "count" counted
// Command, unrecognized.
-res = t.runCommand("invalid"); // "invalid" command only counted on MongoS
+res = t.runCommand("invalid");
assert.eq(0, res.ok);
-assert.eq(opCounters.command + (isMongos ? 9 : 8), newdb.serverStatus().opcounters.command); // "serverStatus" counted
+assert.eq(opCounters.command + 8, newdb.serverStatus().opcounters.command); // "serverStatus" counted
assert.eq(null, newdb.serverStatus().metrics.commands.invalid);
assert.eq(metricsObj['<UNKNOWN>'] + 1, newdb.serverStatus().metrics.commands['<UNKNOWN>']);