コード例 #1
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: gerald-lindsly/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 Object() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i ) {
         client_->insert( ns_.c_str(), BSON( "a" << BSON( "a" << i ) ) );
     }
 }
コード例 #9
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 Count() : ns_( testNs( this ) ) {
     BSONObj obj = BSON( "a" << 1 );
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_, obj );
 }
コード例 #10
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 SortReverse() : ns_( testNs( this ) ) {
     for( int i = 0; i < 50000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << ( 50000 - 1 - i ) ) );
 }
コード例 #14
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 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
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 Capped() : ns_( testNs( this ) ) {
     client_->createCollection( ns_.c_str(), 100000, true );
 }
コード例 #16
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 SortOrdered() : ns_( testNs( this ) ) {
     for( int i = 0; i < 50000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i ) );
 }
コード例 #17
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 TwoIndex() : ns_( testNs( this ) ) {
     client_->ensureIndex( ns_, BSON( "_id" << 1 ), "my_id" );
 }
コード例 #18
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 OneIndexReverse() : ns_( testNs( this ) ) {
     client_->ensureIndex( ns_, BSON( "_id" << 1 ) );
 }
コード例 #19
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 OneIndexHighLow() : ns_( testNs( this ) ) {
     client_->ensureIndex( ns_, BSON( "_id" << 1 ) );
 }
コード例 #20
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 Smaller() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i << "b" << 2 ) );
 }
コード例 #21
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 SetGrow() : ns_( testNs( this ) ) {
     for( int i = 0; i < 10000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i << "i" << "" ) );
 }
コード例 #22
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 void run() {
     string ns = testNs( this );
     for( int i = 0; i < 100000; ++i ) {
         client_->insert( ns.c_str(), BSON( "_id" << i ) );
     }
 }
コード例 #23
0
ファイル: perftest.cpp プロジェクト: DjComandos/mongo
 NoMatchIndex() : ns_( testNs( this ) ) {
     for( int i = 0; i < 100000; ++i )
         client_->insert( ns_.c_str(), BSON( "_id" << i ) );
 }