1
0
Fork 0

added arangob options

This commit is contained in:
Jan Steemann 2012-09-28 17:06:20 +02:00
parent c22be52b43
commit 8eb4ee0311
12 changed files with 58 additions and 71 deletions

View File

@ -26,7 +26,9 @@ number of parallel threads that will issue requests (default is 1 thread)
OPTION "--requests <int32>" OPTION "--requests <int32>"
total number of requests to perform total number of requests to perform
OPTION "--test-case <string>" OPTION "--test-case <string>"
name of test case to perform (possible values: version, smalldoc, bigdoc) name of test case to perform (possible values: "version" and "document")
OPTION "--complexity <int32>"
complexity value for test case (meaning depends on test case)
OPTION "--server.endpoint <string>" OPTION "--server.endpoint <string>"
server endpoint to connect to, consisting of protocol, ip address and port ENDOPTION server endpoint to connect to, consisting of protocol, ip address and port ENDOPTION
OPTION "--server.username <string>" OPTION "--server.username <string>"

View File

@ -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 .SH NAME
arangob - the ArangoDB benchmark and test tool arangob - the ArangoDB benchmark and test tool
.SH SYNOPSIS .SH SYNOPSIS
@ -26,7 +26,9 @@ number of parallel threads that will issue requests (default is 1 thread)
.IP "--requests <int32>" .IP "--requests <int32>"
total number of requests to perform total number of requests to perform
.IP "--test-case <string>" .IP "--test-case <string>"
name of test case to perform (possible values: version, smalldoc, bigdoc) name of test case to perform (possible values: "version" and "document")
.IP "--complexity <int32>"
complexity value for test case (meaning depends on test case)
.IP "--server.endpoint <string>" .IP "--server.endpoint <string>"
server endpoint to connect to, consisting of protocol, ip address and port server endpoint to connect to, consisting of protocol, ip address and port
.IP "--server.username <string>" .IP "--server.username <string>"

View File

@ -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 .SH NAME
arangoimp - a bulk importer for the ArangoDB database arangoimp - a bulk importer for the ArangoDB database
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -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 .SH NAME
arangosh - the ArangoDB shell arangosh - the ArangoDB shell
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -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 .SH NAME
arango-dfdb - a datafile debugger for ArangoDB arango-dfdb - a datafile debugger for ArangoDB
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -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 .SH NAME
arango-password - user setup utility for the ArangoDB database server arango-password - user setup utility for the ArangoDB database server
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -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 .SH NAME
arango-upgrade - upgrade script for the ArangoDB database server arango-upgrade - upgrade script for the ArangoDB database server
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -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 .SH NAME
arangod - the ArangoDB database server arangod - the ArangoDB database server
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -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 .SH NAME
rcarangod - control script for the ArangoDB database server rcarangod - control script for the ArangoDB database server
.SH SYNOPSIS .SH SYNOPSIS

View File

@ -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 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 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)` @ENABLE_ARANGOB_TRUE@ kill `cat $(PIDFILE)`

View File

@ -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 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 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)` kill `cat $(PIDFILE)`

View File

@ -85,6 +85,12 @@ static volatile int Started = 0;
Mutex StartMutex; Mutex StartMutex;
////////////////////////////////////////////////////////////////////////////////
/// @brief use a startup delay
////////////////////////////////////////////////////////////////////////////////
static bool Delay = false;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief concurrency /// @brief concurrency
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -103,6 +109,12 @@ static int Operations = 1000;
static int BatchSize = 0; static int BatchSize = 0;
////////////////////////////////////////////////////////////////////////////////
/// @brief complexity parameter for tests
////////////////////////////////////////////////////////////////////////////////
static size_t Complexity = 1;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief collection to use /// @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 { struct DocumentCreationTest : public BenchmarkOperation {
SmallDocumentCreationTest () DocumentCreationTest ()
: 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<string, string>& headers () {
static const map<string, string> headers;
return headers;
}
string _url;
};
// -----------------------------------------------------------------------------
// --SECTION-- big document creation test
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8Shell
/// @{
////////////////////////////////////////////////////////////////////////////////
struct BigDocumentCreationTest : public BenchmarkOperation {
BigDocumentCreationTest ()
: BenchmarkOperation (), : BenchmarkOperation (),
_url(), _url(),
_buffer(0) { _buffer(0) {
_url = "/_api/document?collection=" + Collection + "&createCollection=true"; _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); _buffer = TRI_CreateSizedStringBuffer(TRI_UNKNOWN_MEM_ZONE, 4096);
TRI_AppendCharStringBuffer(_buffer, '{'); TRI_AppendCharStringBuffer(_buffer, '{');
@ -259,7 +222,7 @@ struct BigDocumentCreationTest : public BenchmarkOperation {
} }
~BigDocumentCreationTest () { ~DocumentCreationTest () {
TRI_Free(TRI_UNKNOWN_MEM_ZONE, _buffer); TRI_Free(TRI_UNKNOWN_MEM_ZONE, _buffer);
} }
@ -319,11 +282,25 @@ static void UpdateStartCounter () {
++Started; ++Started;
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief get the value of the number of started threads counter
////////////////////////////////////////////////////////////////////////////////
static int GetStartCounter () { static int GetStartCounter () {
MUTEX_LOCKER(StartMutex); MUTEX_LOCKER(StartMutex);
return Started; 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 /// @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") ("batch-size", &BatchSize, "number of operations in one batch (0 disables batching")
("collection", &Collection, "collection name to use in tests") ("collection", &Collection, "collection name to use in tests")
("test-case", &TestCase, "test case to use") ("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); BaseClient.setupGeneral(description);
@ -396,17 +375,15 @@ int main (int argc, char* argv[]) {
if (TestCase == "version") { if (TestCase == "version") {
testCase = new VersionTest(); testCase = new VersionTest();
} }
else if (TestCase == "smalldoc") { else if (TestCase == "document") {
testCase = new SmallDocumentCreationTest(); testCase = new DocumentCreationTest();
}
else if (TestCase == "bigdoc") {
testCase = new BigDocumentCreationTest();
} }
else { else {
cerr << "invalid test case name " << TestCase << endl; cerr << "invalid test case name " << TestCase << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
Status("starting threads...");
BenchmarkCounter<unsigned long> operationsCounter(0, (unsigned long) Operations); BenchmarkCounter<unsigned long> operationsCounter(0, (unsigned long) Operations);
ConditionVariable startCondition; ConditionVariable startCondition;
@ -440,6 +417,12 @@ int main (int argc, char* argv[]) {
usleep(5000); usleep(5000);
} }
if (Delay) {
Status("sleeping (startup delay)...");
sleep(15);
}
Status("executing tests...");
Timing timer(Timing::TI_WALLCLOCK); Timing timer(Timing::TI_WALLCLOCK);
// broadcast the start signal to all threads // broadcast the start signal to all threads