This commit is contained in:
Marko Budiselic 2016-03-20 18:41:22 +01:00
commit 8cecbc5ad8
2 changed files with 8 additions and 2 deletions

View File

@ -94,6 +94,8 @@ std::string benchmark_json(const std::string& host,
[](auto acc, auto x) { return acc + x; }
);
auto created_count = counter.load();
std::string json = "{\"total\":" + std::to_string(total / elapsed) + ","
+ " \"per_query\": [";
for(size_t i = 0; i < queries.size(); ++i) {
@ -103,6 +105,6 @@ std::string benchmark_json(const std::string& host,
}
json += ", " + std::to_string(reqs[i] / elapsed);
}
json += "]}";
json += "], \"counter\": " + std::to_string(created_count) + " }";
return json;
}

View File

@ -10,8 +10,12 @@ int main(int argc, char* argv[])
auto port = std::string(argv[2]);
auto connections = std::stoi(argv[3]);
auto duration = std::stod(argv[4]);
auto count = std::stoi(argv[5]);
counter.store(count);
std::vector<std::string> queries;
for (int i = 5; i < argc; ++i) {
for (int i = 6; i < argc; ++i) {
queries.emplace_back(std::string(argv[i]));
}