Skip to content
Snippets Groups Projects
Commit 24e82076 authored by ncteisen's avatar ncteisen
Browse files

Add json out flag to qps driver

parent fb5ad8d2
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
*/ */
#include <iostream> #include <iostream>
#include <fstream>
#include <memory> #include <memory>
#include <set> #include <set>
...@@ -57,6 +58,9 @@ DEFINE_string(qps_server_target_override, "", ...@@ -57,6 +58,9 @@ DEFINE_string(qps_server_target_override, "",
"Override QPS server target to configure in client configs." "Override QPS server target to configure in client configs."
"Only applicable if there is a single benchmark server."); "Only applicable if there is a single benchmark server.");
DEFINE_string(json_file_out, "",
"File to write the JSON output to.");
namespace grpc { namespace grpc {
namespace testing { namespace testing {
...@@ -88,6 +92,13 @@ static std::unique_ptr<ScenarioResult> RunAndReport(const Scenario& scenario, ...@@ -88,6 +92,13 @@ static std::unique_ptr<ScenarioResult> RunAndReport(const Scenario& scenario,
*success = result->server_success(i); *success = result->server_success(i);
} }
if (FLAGS_json_file_out != "") {
std::ofstream json_outfile;
json_outfile.open(FLAGS_json_file_out);
json_outfile << "{\"qps\": " << result->summary().qps() << "}\n";
json_outfile.close();
}
return result; return result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment