memgraph/demo/worker/benchmark_json.cpp

27 lines
631 B
C++
Raw Normal View History

2016-03-16 09:29:42 +08:00
#include "benchmark.hpp"
int main(int argc, char* argv[])
{
if (argc < 6)
std::exit(EXIT_FAILURE);
// read arguments
auto host = std::string(argv[1]);
auto port = std::string(argv[2]);
auto connections = std::stoi(argv[3]);
auto duration = std::stod(argv[4]);
2016-03-21 01:39:25 +08:00
auto count = std::stoi(argv[5]);
counter.store(count);
2016-03-16 09:29:42 +08:00
std::vector<std::string> queries;
2016-03-21 01:39:25 +08:00
for (int i = 6; i < argc; ++i) {
2016-03-16 09:29:42 +08:00
queries.emplace_back(std::string(argv[i]));
}
// print result
std::cout << benchmark_json(host, port, connections, duration, queries);
return 0;
}