0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/evalc.js

33 lines
695 B
JavaScript
Raw Normal View History

2010-08-11 00:14:20 +02:00
t = db.jstests_evalc;
t.drop();
for( i = 0; i < 10; ++i ) {
t.save( {i:i} );
}
// SERVER-1610
function op() {
uri = db.runCommand( "whatsmyuri" ).you;
printjson( uri );
p = db.currentOp().inprog;
for ( var i in p ) {
var o = p[ i ];
if ( o.client == uri ) {
2010-08-26 21:55:24 +02:00
print( "found it" );
2010-08-11 00:14:20 +02:00
return o.opid;
}
}
return -1;
}
2010-08-26 21:55:24 +02:00
s = startParallelShell( "print( 'starting forked:' + Date() ); for ( i=0; i<500000; i++ ){ db.currentOp(); } print( 'ending forked:' + Date() ); " )
2010-08-11 00:14:20 +02:00
2010-08-26 21:55:24 +02:00
print( "starting eval: " + Date() )
2010-08-26 23:17:05 +02:00
for ( i=0; i<20000; i++ ){
2010-08-26 21:55:24 +02:00
db.eval( "db.jstests_evalc.count( {i:10} );" );
}
print( "end eval: " + Date() )
2010-08-11 00:14:20 +02:00
s();