summaryrefslogtreecommitdiff
path: root/jstests/sharding/shard3.js
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-08-27 15:36:08 -0400
committerDavid Storch <david.storch@10gen.com>2014-09-03 09:46:33 -0400
commit391b1121e36fd85d7e85c4442dccf8367e6da770 (patch)
tree0cf17a810a3c242b2c2a6363f9f18589fedc2fb6 /jstests/sharding/shard3.js
parent6bf17f12e3fde9bee14d2bb9c90001080546f867 (diff)
downloadmongo-391b1121e36fd85d7e85c4442dccf8367e6da770.tar.gz
SERVER-14742 delete old explain and turn on explain 2.0
Diffstat (limited to 'jstests/sharding/shard3.js')
-rw-r--r--jstests/sharding/shard3.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/jstests/sharding/shard3.js b/jstests/sharding/shard3.js
index 8b36f809686..5ecf1fb8140 100644
--- a/jstests/sharding/shard3.js
+++ b/jstests/sharding/shard3.js
@@ -1,5 +1,8 @@
// shard3.js
+// Include helpers for analyzing explain output.
+load("jstests/libs/analyze_plan.js");
+
s = new ShardingTest( "shard3" , 2 , 1 , 2 , { enableBalancer : 1 } );
s2 = s._mongos[1];
@@ -64,10 +67,16 @@ var total = doCounts( "before wrong save" )
assert.writeOK(secondary.insert( { _id : 111 , num : -3 } ));
doCounts( "after wrong save" , total , true )
e = a.find().explain();
-assert.eq( 3 , e.n , "ex1" )
-assert.eq( 4 , e.nscanned , "ex2" )
-assert.eq( 4 , e.nscannedObjects , "ex3" )
-assert.eq( 1 , e.nChunkSkips , "ex4" )
+assert.eq( 3 , e.nReturned , "ex1" )
+assert.eq( 0 , e.totalKeysExamined , "ex2" )
+assert.eq( 4 , e.totalDocsExamined , "ex3" )
+
+var chunkSkips = 0;
+for (var shard in e.shards) {
+ var theShard = e.shards[shard][0];
+ chunkSkips += getChunkSkips(theShard.executionStats.executionStages);
+}
+assert.eq( 1 , chunkSkips , "ex4" )
// SERVER-4612
// make sure idhack obeys chunks