mirror of https://gitee.com/bigwinds/arangodb
some figures output
This commit is contained in:
parent
614187c885
commit
876b9219cc
|
@ -26,16 +26,14 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fstream>
|
#include <iomanip>
|
||||||
|
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
#include "ArangoShell/ArangoClient.h"
|
#include "ArangoShell/ArangoClient.h"
|
||||||
#include "Basics/FileUtils.h"
|
|
||||||
#include "Basics/ProgramOptions.h"
|
#include "Basics/ProgramOptions.h"
|
||||||
#include "Basics/ProgramOptionsDescription.h"
|
#include "Basics/ProgramOptionsDescription.h"
|
||||||
#include "Basics/StringUtils.h"
|
#include "Basics/StringUtils.h"
|
||||||
#include "BasicsC/files.h"
|
|
||||||
#include "BasicsC/init.h"
|
#include "BasicsC/init.h"
|
||||||
#include "BasicsC/logging.h"
|
#include "BasicsC/logging.h"
|
||||||
#include "BasicsC/strings.h"
|
#include "BasicsC/strings.h"
|
||||||
|
@ -196,7 +194,6 @@ int main (int argc, char* argv[]) {
|
||||||
SharedCounter<unsigned long> operationsCounter(0, Operations);
|
SharedCounter<unsigned long> operationsCounter(0, Operations);
|
||||||
ConditionVariable startCondition;
|
ConditionVariable startCondition;
|
||||||
|
|
||||||
std::cout << "Concurrency: " << Concurrency << endl;
|
|
||||||
vector<Endpoint*> endpoints;
|
vector<Endpoint*> endpoints;
|
||||||
vector<BenchmarkThread*> threads;
|
vector<BenchmarkThread*> threads;
|
||||||
for (int i = 0; i < Concurrency; ++i) {
|
for (int i = 0; i < Concurrency; ++i) {
|
||||||
|
@ -215,7 +212,10 @@ int main (int argc, char* argv[]) {
|
||||||
thread->start();
|
thread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(100000);
|
usleep(500000);
|
||||||
|
|
||||||
|
|
||||||
|
Timing timer(Timing::TI_WALLCLOCK);
|
||||||
|
|
||||||
{
|
{
|
||||||
ConditionLocker guard(&startCondition);
|
ConditionLocker guard(&startCondition);
|
||||||
|
@ -229,10 +229,16 @@ int main (int argc, char* argv[]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "cycling " << numOperations << "\n";
|
usleep(50000);
|
||||||
usleep(100000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double time = ((double) timer.time()) / 1000000.0;
|
||||||
|
|
||||||
|
cout << "Total number of operations: " << Operations << ", batch size: " << BatchSize << ", concurrency level: " << Concurrency << endl;
|
||||||
|
cout << "Total duration: " << fixed << time << " s" << endl;
|
||||||
|
cout << "Duration per operation: " << fixed << (time / Operations) << " s" << endl;
|
||||||
|
cout << "Duration per operation per thread: " << fixed << (time / Operations * (double) Concurrency) << " s" << endl << endl;
|
||||||
|
|
||||||
for (int i = 0; i < Concurrency; ++i) {
|
for (int i = 0; i < Concurrency; ++i) {
|
||||||
threads[i]->join();
|
threads[i]->join();
|
||||||
delete threads[i];
|
delete threads[i];
|
||||||
|
|
Loading…
Reference in New Issue