mirror of https://gitee.com/bigwinds/arangodb
added arangob options
This commit is contained in:
parent
c22be52b43
commit
8eb4ee0311
|
@ -26,7 +26,9 @@ number of parallel threads that will issue requests (default is 1 thread)
|
|||
OPTION "--requests <int32>"
|
||||
total number of requests to perform
|
||||
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>"
|
||||
server endpoint to connect to, consisting of protocol, ip address and port ENDOPTION
|
||||
OPTION "--server.username <string>"
|
||||
|
|
|
@ -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 <int32>"
|
||||
total number of requests to perform
|
||||
.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>"
|
||||
server endpoint to connect to, consisting of protocol, ip address and port
|
||||
.IP "--server.username <string>"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)`
|
||||
|
||||
|
|
|
@ -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)`
|
||||
|
||||
|
|
|
@ -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<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 ()
|
||||
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<unsigned long> 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
|
||||
|
|
Loading…
Reference in New Issue