summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/perftests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/dbtests/perftests.cpp')
-rw-r--r--src/mongo/dbtests/perftests.cpp10
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 ) {