summaryrefslogtreecommitdiff
path: root/dbtests/perftests.cpp
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2011-03-28 16:10:21 -0400
committerDwight <dwight@10gen.com>2011-03-28 16:10:41 -0400
commita027e5fa543be78d8125816dc7ec41a71f39953d (patch)
treee59c738988f1ba27a7c4a75e7b4cfc0e723864f6 /dbtests/perftests.cpp
parentf45587a30a9537398c01d2a666f7e3f72cd26948 (diff)
downloadmongo-a027e5fa543be78d8125816dc7ec41a71f39953d.tar.gz
add a simple findbyid perf test
Diffstat (limited to 'dbtests/perftests.cpp')
-rw-r--r--dbtests/perftests.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/dbtests/perftests.cpp b/dbtests/perftests.cpp
index c2216c4d2fe..8f68dff7bf0 100644
--- a/dbtests/perftests.cpp
+++ b/dbtests/perftests.cpp
@@ -352,12 +352,21 @@ namespace PerfTests {
class Insert1 : public InsertDup {
const BSONObj x;
+ OID oid;
+ BSONObj query;
public:
- Insert1() : x( BSON("x" << 99) ) { }
+ Insert1() : x( BSON("x" << 99) ) {
+ oid.init();
+ query = BSON("_id" << oid);
+ }
string name() { return "insert-simple"; }
void timed() {
client().insert( ns(), x );
}
+ const char * timed2() {
+ client().findOne(ns(), query);
+ return "findOne_by_id";
+ }
void post() {
assert( client().count(ns()) > 100 );
}