Skip to content
Snippets Groups Projects
Commit 716f7afa authored by Noah Eisen's avatar Noah Eisen Committed by GitHub
Browse files

Merge pull request #11505 from ncteisen/qps-driver-json-out

Add JSON Outfile Flag to QPS Driver
parents 6f51aa36 dc1b51e6
Branches
Tags
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
* *
*/ */
#include <fstream>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <set> #include <set>
...@@ -57,6 +58,8 @@ DEFINE_string(qps_server_target_override, "", ...@@ -57,6 +58,8 @@ 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 +91,13 @@ static std::unique_ptr<ScenarioResult> RunAndReport(const Scenario& scenario, ...@@ -88,6 +91,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 to comment