diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-01-23 17:31:04 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-01-23 17:32:02 -0500 |
commit | 0506366925126fd593c237f9545c743e7a6cbc4f (patch) | |
tree | 86e14b73a43081fb64a4be9efb85c282903be0ab /src/mongo/scripting | |
parent | f104ef1ddb381d41981709bede5092876cafaa19 (diff) | |
download | mongo-0506366925126fd593c237f9545c743e7a6cbc4f.tar.gz |
expection option for benchRnu find
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/bench.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/scripting/bench.cpp b/src/mongo/scripting/bench.cpp index 01291b1e1f0..c2ae2b3d4a4 100644 --- a/src/mongo/scripting/bench.cpp +++ b/src/mongo/scripting/bench.cpp @@ -260,11 +260,17 @@ namespace mongo { int options = e["options"].eoo() ? 0 : e["options"].Int(); int batchSize = e["batchSize"].eoo() ? 0 : e["batchSize"].Int(); BSONObj filter = e["filter"].eoo() ? BSONObj() : e["filter"].Obj(); + int expected = e["expected"].eoo() ? -1 : e["expected"].Int(); auto_ptr<DBClientCursor> cursor = conn->query( ns, fixQuery( e["query"].Obj() ), limit, skip, &filter, options, batchSize ); int count = cursor->itcount(); + if ( expected >= 0 && count != expected ) { + cout << "bench query on: " << ns << " expected: " << expected << " got: " << cout << endl; + assert(false); + } + if( check ){ BSONObj thisValue = BSON( "count" << count ); int err = scope->invoke( scopeFunc , 0 , &thisValue, 1000 * 60 , false ); |