diff options
Diffstat (limited to 'jstests/repl/basic1.js')
-rw-r--r-- | jstests/repl/basic1.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/jstests/repl/basic1.js b/jstests/repl/basic1.js index 15fc983..4a6091d 100644 --- a/jstests/repl/basic1.js +++ b/jstests/repl/basic1.js @@ -60,7 +60,7 @@ r = function( key , v ){ correct = { a : 2 , b : 1 }; function checkMR( t ){ - var res = t.mapReduce( m , r , "basic1_out" ); + var res = t.mapReduce( m , r , { out : { inline : 1 } } ) assert.eq( correct , res.convertToSingleObject() , "checkMR: " + tojson( t ) ); } @@ -148,6 +148,23 @@ x = { _id : 1 , x : 1 } assert.eq( x , am.mu1.findOne() , "mu1" ); assert.soon( function(){ z = as.mu1.findOne(); printjson( z ); return friendlyEqual( x , z ); } , "mu2" ) +// profiling - this sould be last + +am.setProfilingLevel( 2 ) +am.foo.insert( { x : 1 } ) +am.foo.findOne() +block(); +assert.eq( 2 , am.system.profile.count() , "P1" ) +assert.eq( 0 , as.system.profile.count() , "P2" ) + +assert.eq( 1 , as.foo.findOne().x , "P3" ); +assert.eq( 0 , as.system.profile.count() , "P4" ) + +assert( as.getCollectionNames().indexOf( "system.profile" ) < 0 , "P4.5" ) + +as.setProfilingLevel(2) +as.foo.findOne(); +assert.eq( 1 , as.system.profile.count() , "P5" ) rt.stop(); |