Skip to content

Instantly share code, notes, and snippets.

@alq666
Created February 21, 2011 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alq666/837803 to your computer and use it in GitHub Desktop.
Save alq666/837803 to your computer and use it in GitHub Desktop.
Simple test harness for mongo
db.foo.drop();
db.foo.insert( { _id : 1 } )
ops = [{ op : "findOne" , ns : "test.foo" , query : { _id : 1 } }]
for ( x = 1; x<=128; x*=2){
res = benchRun( { parallel: x, seconds: 5, ops: ops } )
print( "threads: " + x + "\t queries/sec: " + res.query )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment