Пример #1
0
 String() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i ) {
         stringstream ss;
         ss << i;
         client_->insert( ns_.c_str(), BSON( "a" << ss.str() ) );
     }
 }
Пример #2
0
 TenIndex() : ns_( testNs( this ) ) {
     const char *names = "aaaaaaaaa";
     for( int i = 0; i < 9; ++i ) {
         client_->resetIndexCache();
         client_->ensureIndex( ns_.c_str(), BSON( "_id" << 1 ), false, names + i );
     }
 }
Пример #3
0
 ObjectId() : ns_( testNs( this ) ) {
     OID id;
     for( int i = 0; i < 100000; ++i ) {
         id.init();
         client_->insert( ns_.c_str(), BSON( "a" << id ) );
     }
 }
Пример #4
0
 Query() : ns_( testNs( this ) ) {
     const char *names = "aaaaaaaaaa";
     for( int i = 0; i < 10; ++i ) {
         client_->resetIndexCache();
         client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i );
     }
     lk_.reset( new Lock::GlobalWrite );
 }
Пример #5
0
 NoMatchLong() : ns_( testNs( this ) ) {
     const char *names = "aaaaaaaaaa";
     for( int i = 0; i < 100000; ++i ) {
         BSONObjBuilder b;
         for( int j = 0; j < 10; ++j )
             b << ( names + j ) << i;
         client_->insert( ns_.c_str(), b.obj() );
     }
 }
Пример #6
0
 Hint() : ns_( testNs( this ) ) {
     const char *names = "aaaaaaaaa";
     for( int i = 0; i < 9; ++i ) {
         client_->resetIndexCache();
         client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i );
     }
     _lk.reset( new Lock::GlobalWrite );
     _ctx.reset( new Client::Context( ns_ ) );
     hint_ = BSON( "hint" << BSON( "a" << 1 ) );
 }
Пример #7
0
 Hint() : ns_( testNs( this ) ) {
     const char *names = "aaaaaaaaa";
     for( int i = 0; i < 9; ++i ) {
         client_->resetIndexCache();
         client_->ensureIndex( ns_.c_str(), BSON( ( names + i ) << 1 ), false, names + i );
     }
     lk_.reset( new dblock );
     Client::Context ctx( ns_ );
     hint_ = BSON( "hint" << BSON( "a" << 1 ) );
 }
Пример #8
0
 Object() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i ) {
         client_->insert( ns_.c_str(), BSON( "a" << BSON( "a" << i ) ) );
     }
 }
Пример #9
0
 Count() : ns_( testNs( this ) ) {
     BSONObj obj = BSON( "a" << 1 );
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_, obj );
 }
Пример #10
0
 CountSimpleIndex() : ns_( testNs( this ) ) {
     BSONObj obj = BSON( "a" << "b" );
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_, obj );
     client_->ensureIndex( ns_, obj );
 }
Пример #11
0
 GetMoreIndex() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_.c_str(), BSON( "a" << i ) );
     client_->ensureIndex( ns_, BSON( "a" << 1 ) );
     c_ = client_->query( ns_.c_str(), QUERY( "a" << GT << -1 ).hint( BSON( "a" << 1 ) ) );
 }
Пример #12
0
 GetMoreKeyMatchHelps() : ns_( testNs( this ) ) {
     for( int i = 0; i < 1000000; ++i )
         client_->insert( ns_.c_str(), BSON( "a" << i << "b" << i % 10 << "c" << "d" ) );
     client_->ensureIndex( ns_, BSON( "a" << 1 << "b" << 1 ) );
     c_ = client_->query( ns_.c_str(), QUERY( "a" << GT << -1 << "b" << 0 ).hint( BSON( "a" << 1 << "b" << 1 ) ) );
 }
Пример #13
0
 SortReverse() : ns_( testNs( this ) ) {
     for( int i = 0; i < 50000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << ( 50000 - 1 - i ) ) );
 }
Пример #14
0
 GetMore() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_.c_str(), BSON( "a" << i ) );
     c_ = client_->query( ns_.c_str(), Query() );
 }
Пример #15
0
 Capped() : ns_( testNs( this ) ) {
     client_->createCollection( ns_.c_str(), 100000, true );
 }
Пример #16
0
 SortOrdered() : ns_( testNs( this ) ) {
     for( int i = 0; i < 50000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i ) );
 }
Пример #17
0
 TwoIndex() : ns_( testNs( this ) ) {
     client_->ensureIndex( ns_, BSON( "_id" << 1 ), "my_id" );
 }
Пример #18
0
 OneIndexReverse() : ns_( testNs( this ) ) {
     client_->ensureIndex( ns_, BSON( "_id" << 1 ) );
 }
Пример #19
0
 OneIndexHighLow() : ns_( testNs( this ) ) {
     client_->ensureIndex( ns_, BSON( "_id" << 1 ) );
 }
Пример #20
0
 Smaller() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i << "b" << 2 ) );
 }
Пример #21
0
 SetGrow() : ns_( testNs( this ) ) {
     for( int i = 0; i < 10000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i << "i" << "" ) );
 }
Пример #22
0
 void run() {
     string ns = testNs( this );
     for( int i = 0; i < 100000; ++i ) {
         client_->insert( ns.c_str(), BSON( "_id" << i ) );
     }
 }
Пример #23
0
 NoMatchIndex() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i ) );
 }