diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-10-16 18:10:09 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-10-16 18:12:35 -0400 |
commit | b45634307b09030fe8e157120d616464ed947129 (patch) | |
tree | ffb2230b360d083dcabc62dc0d3a4da2e6ca3834 /jstests/slowNightly | |
parent | ef03c91415753ee793c5512bf8588f3e60ff8d40 (diff) | |
download | mongo-b45634307b09030fe8e157120d616464ed947129.tar.gz |
threaded index test mod for SERVER-3961
Diffstat (limited to 'jstests/slowNightly')
-rw-r--r-- | jstests/slowNightly/index_hammer1.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/slowNightly/index_hammer1.js b/jstests/slowNightly/index_hammer1.js new file mode 100644 index 00000000000..87fd3820f66 --- /dev/null +++ b/jstests/slowNightly/index_hammer1.js @@ -0,0 +1,23 @@ + +t = db.index_hammer1; +t.drop(); + +for ( i=0; i<10000; i++ ) + t.insert( { x : i , y : i } ); +db.getLastError(); + +ops = [] + +for ( i=0; i<50; i++ ) + ops.push( { op : "find" , ns : t.getFullName() , query : { x : { $gt : 5000 } , y : { $gt : 5000 } } } ) + +ops[10] = { op : "createIndex" , ns : t.getFullName() , key : { x : 1 } } +ops[20] = { op : "createIndex" , ns : t.getFullName() , key : { y : 1 } } +ops[30] = { op : "dropIndex" , ns : t.getFullName() , key : { x : 1 } } +ops[40] = { op : "dropIndex" , ns : t.getFullName() , key : { y : 1 } } + +res = benchRun( { ops : ops , parallel : 5 , seconds : 20 , host : db.getMongo().host } ) +printjson( res ) + +assert.eq( 10000 , t.count() ); + |