diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-05-07 14:44:36 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-05-07 14:46:37 -0400 |
commit | 60388786785233dd5a7897710ef40d919ec4832c (patch) | |
tree | c5dfc7ddcbe62e11ac05086b3cd9b5ec2137b233 /scripting | |
parent | 09bf5bbf6b12b006b2ffbdb42f9bcf7e5838a656 (diff) | |
download | mongo-60388786785233dd5a7897710ef40d919ec4832c.tar.gz |
support update in benchRun
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/bench.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripting/bench.cpp b/scripting/bench.cpp index 27239853fbd..fe099b5739a 100644 --- a/scripting/bench.cpp +++ b/scripting/bench.cpp @@ -54,7 +54,7 @@ namespace mongo { string db; unsigned parallel; - int seconds; + double seconds; BSONObj ops; @@ -78,12 +78,15 @@ namespace mongo { if ( op == "findOne" ) { conn->findOne( ns , e["query"].Obj() ); } + else if ( op == "update" ) { + conn->update( ns , e["query"].Obj() , e["update"].Obj() ); + } else { log() << "don't understand op: " << op << endl; config->error = true; return; } - + } } @@ -109,7 +112,7 @@ namespace mongo { if ( args["parallel"].isNumber() ) config.parallel = args["parallel"].numberInt(); if ( args["seconds"].isNumber() ) - config.seconds = args["seconds"].numberInt(); + config.seconds = args["seconds"].number(); config.ops = args["ops"].Obj(); @@ -130,7 +133,7 @@ namespace mongo { BSONObj before; conn->simpleCommand( "admin" , &before , "serverStatus" ); - sleepsecs( config.seconds ); + sleepmillis( (int)(1000.0 * config.seconds) ); BSONObj after; conn->simpleCommand( "admin" , &after , "serverStatus" ); |