From 9065c175bde43c3f1172dc00c14a478e17cf48da Mon Sep 17 00:00:00 2001 From: Dwight Date: Mon, 20 Dec 2010 16:55:16 -0500 Subject: [PATCH] test work --- dbtests/perftests.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/dbtests/perftests.cpp b/dbtests/perftests.cpp index d1fd2b05103..367cd61594f 100644 --- a/dbtests/perftests.cpp +++ b/dbtests/perftests.cpp @@ -83,7 +83,7 @@ namespace PerfTests { break; } int ms = t.millis(); - cout << n << ' ' << ms << "ms" << " expect:" << expectation() << endl; + cout << n << "/sec " << ms << "ms" << " expect:" << expectation() << endl; if( n < expectation() ) { #if !defined(_DEBUG) @@ -97,7 +97,7 @@ namespace PerfTests { class InsertDup : public B { const BSONObj o; public: - InsertDup() : o( BSON("_id" << 1) ) { } + InsertDup() : o( BSON("_id" << 1) ) { } // dup keys string name() { return "InsertDup"; } @@ -112,24 +112,33 @@ namespace PerfTests { } unsigned long long expectation() { return 1000; } }; - - class Update : public B { + + /* + class Insert : public InsertDup { public: - string name() { return "update"; } - void prep() { } + InsertDup() : o( BSON("_id" << 1) ) { } // dup keys + string name() { + return "InsertDup"; + } + void prep() { + client().insert( ns(), o ); + } void timed() { - client().insert( ns(), fromjson( "{'_id':0}" ) ); + client().insert( ns(), o ); + } + void post() { + assert( client().count(ns()) == 1 ); } unsigned long long expectation() { return 1000; } }; - + */ class All : public Suite { public: All() : Suite( "perf" ) { } void setupTests(){ add< InsertDup >(); - add< Update >(); + //add< Insert >(); } } myall; }