diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-07-01 03:56:39 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-07-01 09:04:58 -0400 |
commit | f64357e485c8d46bd6fd393f7416df6117672de1 (patch) | |
tree | a90f2bb933dd4a1c2e774ac4e280e8ce7dbcbaeb /src/mongo/dbtests/perftests.cpp | |
parent | e7e24a657b64fa59c30b063c72ff4cbee9674b7e (diff) | |
download | mongo-f64357e485c8d46bd6fd393f7416df6117672de1.tar.gz |
SERVER-13961 Add OperationContext argument to Client::Context
Time tracking and database access in Client::Context require access to the
OperationContext. Adding it as argument.
This is in preparation for removing LockState from Client.
Diffstat (limited to 'src/mongo/dbtests/perftests.cpp')
-rw-r--r-- | src/mongo/dbtests/perftests.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/dbtests/perftests.cpp b/src/mongo/dbtests/perftests.cpp index 74eb31e8f68..3536b8ec07e 100644 --- a/src/mongo/dbtests/perftests.cpp +++ b/src/mongo/dbtests/perftests.cpp @@ -41,6 +41,7 @@ #include <fstream> #include "mongo/db/db.h" +#include "mongo/db/operation_context_impl.h" #include "mongo/db/storage/mmap_v1/durable_mapped_file.h" #include "mongo/db/storage/mmap_v1/dur_stats.h" #include "mongo/db/instance.h" @@ -71,8 +72,8 @@ namespace PerfTests { class ClientBase { public: // NOTE: Not bothering to backup the old error record. - ClientBase() { - mongo::lastError.reset( new LastError() ); + ClientBase() : _client(&_txn) { + mongo::lastError.reset(new LastError()); } virtual ~ClientBase() { @@ -91,6 +92,7 @@ namespace PerfTests { DBClientBase* client() { return &_client; } private: + OperationContextImpl _txn; DBDirectClient _client; }; @@ -356,7 +358,9 @@ namespace PerfTests { static int z; srand( ++z ^ (unsigned) time(0)); #endif - DBDirectClient c; + OperationContextImpl txn; + DBDirectClient c(&txn); + Client::initThreadIfNotAlready("perftestthr"); const unsigned int Batch = batchSize(); while( 1 ) { |