From 24e820762a9c6b8a5c4179ea39571d0f1a3b5d2c Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 14 Jun 2017 19:56:29 -0700 Subject: Add json out flag to qps driver --- test/cpp/qps/qps_json_driver.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index a946992100..6fcdaeb974 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -17,6 +17,7 @@ */ #include +#include #include #include @@ -57,6 +58,9 @@ DEFINE_string(qps_server_target_override, "", "Override QPS server target to configure in client configs." "Only applicable if there is a single benchmark server."); +DEFINE_string(json_file_out, "", + "File to write the JSON output to."); + namespace grpc { namespace testing { @@ -88,6 +92,13 @@ static std::unique_ptr RunAndReport(const Scenario& scenario, *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; } -- cgit v1.2.3 From dc1b51e6b380ecea72622aca9c6677dfab556a13 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 19 Jun 2017 09:00:25 -0700 Subject: clang fmt --- test/cpp/qps/qps_json_driver.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index 6fcdaeb974..590c22ec29 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -16,8 +16,8 @@ * */ -#include #include +#include #include #include @@ -58,8 +58,7 @@ DEFINE_string(qps_server_target_override, "", "Override QPS server target to configure in client configs." "Only applicable if there is a single benchmark server."); -DEFINE_string(json_file_out, "", - "File to write the JSON output to."); +DEFINE_string(json_file_out, "", "File to write the JSON output to."); namespace grpc { namespace testing { -- cgit v1.2.3