mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
support update in benchRun
This commit is contained in:
parent
09bf5bbf6b
commit
6038878678
@ -54,7 +54,7 @@ namespace mongo {
|
||||
string db;
|
||||
|
||||
unsigned parallel;
|
||||
int seconds;
|
||||
double seconds;
|
||||
|
||||
BSONObj ops;
|
||||
|
||||
@ -78,6 +78,9 @@ 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;
|
||||
@ -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" );
|
||||
|
Loading…
Reference in New Issue
Block a user