diff options
author | Dwight <dwight@10gen.com> | 2011-01-06 09:16:00 -0500 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2011-01-06 09:16:12 -0500 |
commit | cd969593bc310b513b81d47e2838f1448cf15f7c (patch) | |
tree | cb806c29bf076b376ba4066c517f0721a5829fe6 /dbtests | |
parent | da0bc2917778593d0368b89427d9d504a1230389 (diff) | |
download | mongo-cd969593bc310b513b81d47e2838f1448cf15f7c.tar.gz |
tiny bit more of a concurrency test
Diffstat (limited to 'dbtests')
-rw-r--r-- | dbtests/perftests.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/dbtests/perftests.cpp b/dbtests/perftests.cpp index b2c140377e2..337e6f2ab9d 100644 --- a/dbtests/perftests.cpp +++ b/dbtests/perftests.cpp @@ -286,10 +286,42 @@ namespace PerfTests { } }; + void t() { + for( int i = 0; i < 20; i++ ) { + sleepmillis(21); + string fn = "/tmp/t1"; + MongoMMF f; + unsigned long long len = 1 * 1024 * 1024; + assert( f.create(fn, len, /*sequential*/rand()%2==0) ); + if( !testIntent ) { + char *p = (char *) f.getView(); + assert(p); + // write something to the private view as a test + strcpy(p, "hello"); + } + if( cmdLine.dur ) { + char *w = (char *) f.view_write(); + strcpy(w + 6, "world"); + } + MongoFileFinder ff; + ASSERT( ff.findByPath(fn) ); + } + } + class All : public Suite { public: - All() : Suite( "perf" ) { + All() : Suite( "perf" ) + { } + ~All() { + } + Result * run( const string& filter ) { + boost::thread a(t); + Result * res = Suite::run(filter); + a.join(); + return res; + } + void setupTests() { add< TaskQueueTest >(); add< InsertDup >(); @@ -302,4 +334,3 @@ namespace PerfTests { } } myall; } - |