0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
This commit is contained in:
dwight 2011-01-01 17:27:10 -05:00
parent 15465b598d
commit d7a81395c3

View File

@ -1,29 +1,29 @@
t = db.cursora
function run( n , atomic ){
function run( n , atomic ){
assert(isNumber(n), "cursora.js isNumber");
t.drop()
for ( i=0; i<n; i++ )
t.insert( { _id : i } )
db.getLastError()
db.getLastError()
print("cursora.js startParallelShell n:"+n+" atomic:"+atomic)
join = startParallelShell( "sleep(50); db.cursora.remove( {" + ( atomic ? "$atomic:true" : "" ) + "} ); db.getLastError();" );
var start = null;
var ex = null;
var num = null;
var end = null;
try {
start = new Date()
ex = t.find(function () { num = 2; for (var x = 0; x < 1000; x++) num += 2; return num > 0; }).sort({ _id: -1 }).explain()
num = ex.n
end = new Date()
}
catch (e) {
print("cursora.js FAIL " + e);
join();
join = startParallelShell( "sleep(50); db.cursora.remove( {" + ( atomic ? "$atomic:true" : "" ) + "} ); db.getLastError();" );
var start = null;
var ex = null;
var num = null;
var end = null;
try {
start = new Date()
ex = t.find(function () { num = 2; for (var x = 0; x < 1000; x++) num += 2; return num > 0; }).sort({ _id: -1 }).explain()
num = ex.n
end = new Date()
}
catch (e) {
print("cursora.js FAIL " + e);
join();
throw e;
}
@ -39,5 +39,5 @@ function run( n , atomic ){
run( 1500 )
run( 5000 )
run( 1500 , true )
run( 5000 , true )
run( 5000 , true )
print("cursora.js SUCCESS")