diff --git a/Documentation/man1/arangob b/Documentation/man1/arangob index 1399e80aa9..0d3a5e0962 100644 --- a/Documentation/man1/arangob +++ b/Documentation/man1/arangob @@ -26,7 +26,9 @@ number of parallel threads that will issue requests (default is 1 thread) OPTION "--requests " total number of requests to perform OPTION "--test-case " -name of test case to perform (possible values: version, smalldoc, bigdoc) +name of test case to perform (possible values: "version" and "document") +OPTION "--complexity " +complexity value for test case (meaning depends on test case) OPTION "--server.endpoint " server endpoint to connect to, consisting of protocol, ip address and port ENDOPTION OPTION "--server.username " diff --git a/Doxygen/man/man1/arangob.1 b/Doxygen/man/man1/arangob.1 index 053b312903..853f97868d 100644 --- a/Doxygen/man/man1/arangob.1 +++ b/Doxygen/man/man1/arangob.1 @@ -1,4 +1,4 @@ -.TH arangob 1 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH arangob 1 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME arangob - the ArangoDB benchmark and test tool .SH SYNOPSIS @@ -26,7 +26,9 @@ number of parallel threads that will issue requests (default is 1 thread) .IP "--requests " total number of requests to perform .IP "--test-case " -name of test case to perform (possible values: version, smalldoc, bigdoc) +name of test case to perform (possible values: "version" and "document") +.IP "--complexity " +complexity value for test case (meaning depends on test case) .IP "--server.endpoint " server endpoint to connect to, consisting of protocol, ip address and port .IP "--server.username " diff --git a/Doxygen/man/man1/arangoimp.1 b/Doxygen/man/man1/arangoimp.1 index cd406601f2..c22731c948 100644 --- a/Doxygen/man/man1/arangoimp.1 +++ b/Doxygen/man/man1/arangoimp.1 @@ -1,4 +1,4 @@ -.TH arangoimp 1 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH arangoimp 1 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME arangoimp - a bulk importer for the ArangoDB database .SH SYNOPSIS diff --git a/Doxygen/man/man1/arangosh.1 b/Doxygen/man/man1/arangosh.1 index 245fca4f96..60ebf20914 100644 --- a/Doxygen/man/man1/arangosh.1 +++ b/Doxygen/man/man1/arangosh.1 @@ -1,4 +1,4 @@ -.TH arangosh 1 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH arangosh 1 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME arangosh - the ArangoDB shell .SH SYNOPSIS diff --git a/Doxygen/man/man8/arango-dfdb.8 b/Doxygen/man/man8/arango-dfdb.8 index 6d2523f32b..3708024872 100644 --- a/Doxygen/man/man8/arango-dfdb.8 +++ b/Doxygen/man/man8/arango-dfdb.8 @@ -1,4 +1,4 @@ -.TH arango-dfdb 8 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH arango-dfdb 8 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME arango-dfdb - a datafile debugger for ArangoDB .SH SYNOPSIS diff --git a/Doxygen/man/man8/arango-password.8 b/Doxygen/man/man8/arango-password.8 index cf5e1e6135..10928dabba 100644 --- a/Doxygen/man/man8/arango-password.8 +++ b/Doxygen/man/man8/arango-password.8 @@ -1,4 +1,4 @@ -.TH arango-password 8 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH arango-password 8 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME arango-password - user setup utility for the ArangoDB database server .SH SYNOPSIS diff --git a/Doxygen/man/man8/arango-upgrade.8 b/Doxygen/man/man8/arango-upgrade.8 index 1a0bb93aa2..d77d8dede8 100644 --- a/Doxygen/man/man8/arango-upgrade.8 +++ b/Doxygen/man/man8/arango-upgrade.8 @@ -1,4 +1,4 @@ -.TH arango-upgrade 8 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH arango-upgrade 8 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME arango-upgrade - upgrade script for the ArangoDB database server .SH SYNOPSIS diff --git a/Doxygen/man/man8/arangod.8 b/Doxygen/man/man8/arangod.8 index 772476fd98..c49f6a264b 100644 --- a/Doxygen/man/man8/arangod.8 +++ b/Doxygen/man/man8/arangod.8 @@ -1,4 +1,4 @@ -.TH arangod 8 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH arangod 8 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME arangod - the ArangoDB database server .SH SYNOPSIS diff --git a/Doxygen/man/man8/rcarangod.8 b/Doxygen/man/man8/rcarangod.8 index de2e2c8c95..4419a3f9f8 100644 --- a/Doxygen/man/man8/rcarangod.8 +++ b/Doxygen/man/man8/rcarangod.8 @@ -1,4 +1,4 @@ -.TH rcarangod 8 "Fr 28. Sep 11:56:58 CEST 2012" "" "ArangoDB" +.TH rcarangod 8 "Fr 28. Sep 16:38:43 CEST 2012" "" "ArangoDB" .SH NAME rcarangod - control script for the ArangoDB database server .SH SYNOPSIS diff --git a/Makefile.in b/Makefile.in index eff22fd387..a76e1b4653 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5545,7 +5545,7 @@ unittests-bitarray-index: @ENABLE_ARANGOB_TRUE@ $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 1000 --batch-size 16 --concurrency 2 --test version || test "x$(FORCE)" == "x1" @ENABLE_ARANGOB_TRUE@ $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 100 --batch-size 0 --concurrency 1 --test version || test "x$(FORCE)" == "x1" -@ENABLE_ARANGOB_TRUE@ $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 100 --batch-size 10 --concurrency 2 --test smalldoc || test "x$(FORCE)" == "x1" +@ENABLE_ARANGOB_TRUE@ $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 100 --batch-size 10 --concurrency 2 --test document --complexity 1 || test "x$(FORCE)" == "x1" @ENABLE_ARANGOB_TRUE@ kill `cat $(PIDFILE)` diff --git a/UnitTests/Makefile.files b/UnitTests/Makefile.files index 172935004b..0579314f51 100755 --- a/UnitTests/Makefile.files +++ b/UnitTests/Makefile.files @@ -457,7 +457,7 @@ unittests-arangob: $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 1000 --batch-size 16 --concurrency 2 --test version || test "x$(FORCE)" == "x1" $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 100 --batch-size 0 --concurrency 1 --test version || test "x$(FORCE)" == "x1" - $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 100 --batch-size 10 --concurrency 2 --test smalldoc || test "x$(FORCE)" == "x1" + $(VALGRIND) @builddir@/bin/arangob --configuration none --quiet --server.username "$(USERNAME)" --server.password "$(PASSWORD)" --server.endpoint unix://$(VOCDIR)/arango.sock --requests 100 --batch-size 10 --concurrency 2 --test document --complexity 1 || test "x$(FORCE)" == "x1" kill `cat $(PIDFILE)` diff --git a/arangosh/Benchmark/arangob.cpp b/arangosh/Benchmark/arangob.cpp index bee89d05d0..ca7e76e701 100644 --- a/arangosh/Benchmark/arangob.cpp +++ b/arangosh/Benchmark/arangob.cpp @@ -85,6 +85,12 @@ static volatile int Started = 0; Mutex StartMutex; +//////////////////////////////////////////////////////////////////////////////// +/// @brief use a startup delay +//////////////////////////////////////////////////////////////////////////////// + +static bool Delay = false; + //////////////////////////////////////////////////////////////////////////////// /// @brief concurrency //////////////////////////////////////////////////////////////////////////////// @@ -103,6 +109,12 @@ static int Operations = 1000; static int BatchSize = 0; +//////////////////////////////////////////////////////////////////////////////// +/// @brief complexity parameter for tests +//////////////////////////////////////////////////////////////////////////////// + +static size_t Complexity = 1; + //////////////////////////////////////////////////////////////////////////////// /// @brief collection to use //////////////////////////////////////////////////////////////////////////////// @@ -175,7 +187,7 @@ struct VersionTest : public BenchmarkOperation { //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- -// --SECTION-- small document creation test +// --SECTION-- document creation test // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// @@ -183,63 +195,14 @@ struct VersionTest : public BenchmarkOperation { /// @{ //////////////////////////////////////////////////////////////////////////////// -struct SmallDocumentCreationTest : public BenchmarkOperation { - SmallDocumentCreationTest () - : BenchmarkOperation(), - _url() { - _url = "/_api/document?collection=" + Collection + "&createCollection=true"; - } - - ~SmallDocumentCreationTest () { - } - - string collectionName () { - return Collection; - } - - const bool useCollection () const { - return true; - } - - const string& url () { - return _url; - } - - const HttpRequest::HttpRequestType type () { - return HttpRequest::HTTP_REQUEST_POST; - } - - const char* payload (size_t* length, const size_t counter) { - static const char* payload = "{\"test\":1}"; - *length = 10; - return payload; - } - - const map& headers () { - static const map headers; - return headers; - } - - string _url; -}; - -// ----------------------------------------------------------------------------- -// --SECTION-- big document creation test -// ----------------------------------------------------------------------------- - -//////////////////////////////////////////////////////////////////////////////// -/// @addtogroup V8Shell -/// @{ -//////////////////////////////////////////////////////////////////////////////// - -struct BigDocumentCreationTest : public BenchmarkOperation { - BigDocumentCreationTest () +struct DocumentCreationTest : public BenchmarkOperation { + DocumentCreationTest () : BenchmarkOperation (), _url(), _buffer(0) { _url = "/_api/document?collection=" + Collection + "&createCollection=true"; - const size_t n = 100; + const size_t n = Complexity; _buffer = TRI_CreateSizedStringBuffer(TRI_UNKNOWN_MEM_ZONE, 4096); TRI_AppendCharStringBuffer(_buffer, '{'); @@ -259,7 +222,7 @@ struct BigDocumentCreationTest : public BenchmarkOperation { } - ~BigDocumentCreationTest () { + ~DocumentCreationTest () { TRI_Free(TRI_UNKNOWN_MEM_ZONE, _buffer); } @@ -319,11 +282,25 @@ static void UpdateStartCounter () { ++Started; } +//////////////////////////////////////////////////////////////////////////////// +/// @brief get the value of the number of started threads counter +//////////////////////////////////////////////////////////////////////////////// + static int GetStartCounter () { MUTEX_LOCKER(StartMutex); return Started; } +//////////////////////////////////////////////////////////////////////////////// +/// @brief print a status line (if ! quiet) +//////////////////////////////////////////////////////////////////////////////// + +static void Status (const string& value) { + if (! BaseClient.quiet()) { + cout << value << endl; + } +} + //////////////////////////////////////////////////////////////////////////////// /// @brief parses the program options //////////////////////////////////////////////////////////////////////////////// @@ -337,6 +314,8 @@ static void ParseProgramOptions (int argc, char* argv[]) { ("batch-size", &BatchSize, "number of operations in one batch (0 disables batching") ("collection", &Collection, "collection name to use in tests") ("test-case", &TestCase, "test case to use") + ("complexity", &Complexity, "complexity parameter for the test") + ("delay", &Delay, "use a startup delay (necessary only when run in series)") ; BaseClient.setupGeneral(description); @@ -396,17 +375,15 @@ int main (int argc, char* argv[]) { if (TestCase == "version") { testCase = new VersionTest(); } - else if (TestCase == "smalldoc") { - testCase = new SmallDocumentCreationTest(); - } - else if (TestCase == "bigdoc") { - testCase = new BigDocumentCreationTest(); + else if (TestCase == "document") { + testCase = new DocumentCreationTest(); } else { cerr << "invalid test case name " << TestCase << endl; exit(EXIT_FAILURE); } + Status("starting threads..."); BenchmarkCounter operationsCounter(0, (unsigned long) Operations); ConditionVariable startCondition; @@ -440,6 +417,12 @@ int main (int argc, char* argv[]) { usleep(5000); } + if (Delay) { + Status("sleeping (startup delay)..."); + sleep(15); + } + Status("executing tests..."); + Timing timer(Timing::TI_WALLCLOCK); // broadcast the start signal to all threads