From 0895545a587e8e1f986eb813580277d88a7de55f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 29 Sep 2016 11:01:14 -0700 Subject: [PATCH] Complete reporting for failure rates --- src/proto/grpc/testing/control.proto | 4 ++-- test/cpp/qps/client.h | 2 +- test/cpp/qps/driver.cc | 7 ++++--- test/cpp/qps/qps_json_driver.cc | 5 ----- test/cpp/qps/report.cc | 6 ++++++ 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/proto/grpc/testing/control.proto b/src/proto/grpc/testing/control.proto index 83c41508a7a..4adf235f617 100644 --- a/src/proto/grpc/testing/control.proto +++ b/src/proto/grpc/testing/control.proto @@ -220,8 +220,8 @@ message ScenarioResultSummary double latency_999 = 11; // Number of requests that succeeded/failed - int64 successful_requests = 12; - int64 failed_requests = 13; + double successful_requests_per_second = 12; + double failed_requests_per_second = 13; } // Results of a single benchmark scenario. diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index 100d038ff29..9983c8a7b08 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -321,7 +321,7 @@ class Client { histogram_.Add(entry.value()); } if (entry.status_used()) { - statuses_[entry.value()]++; + statuses_[entry.status()]++; } if (!thread_still_ok) { gpr_log(GPR_ERROR, "Finishing client thread due to RPC error"); diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 29e53f383dd..0168a525ceb 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -132,7 +132,8 @@ static void postprocess_scenario_result(ScenarioResult* result) { Histogram histogram; histogram.MergeProto(result->latencies()); - auto qps = histogram.Count() / average(result->client_stats(), WallTime); + auto time_estimate = average(result->client_stats(), WallTime); + auto qps = histogram.Count() / time_estimate; auto qps_per_server_core = qps / sum(result->server_cores(), Cores); result->mutable_summary()->set_qps(qps); @@ -169,8 +170,8 @@ static void postprocess_scenario_result(ScenarioResult* result) { failures += rrc.count(); } } - result->mutable_summary()->set_successful_requests(successes); - result->mutable_summary()->set_failed_requests(successes); + result->mutable_summary()->set_successful_requests_per_second(successes / time_estimate); + result->mutable_summary()->set_failed_requests_per_second(failures / time_estimate); } } diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index 4a9745c66e1..1524ebbc389 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -110,11 +110,6 @@ static bool QpsDriver() { GetReporter()->ReportLatency(*result); GetReporter()->ReportTimes(*result); - if (result->mutable_summary()->failed_requests()) { - std::cerr << "# failed requests: " - << result->mutable_summary()->failed_requests() << "\n"; - } - for (int i = 0; success && i < result->client_success_size(); i++) { success = result->client_success(i); } diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index 2ec7d8676c2..41617e968a5 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -73,6 +73,12 @@ void CompositeReporter::ReportTimes(const ScenarioResult& result) { void GprLogReporter::ReportQPS(const ScenarioResult& result) { gpr_log(GPR_INFO, "QPS: %.1f", result.summary().qps()); + if (result.summary().failed_requests_per_second() > 0) { + gpr_log(GPR_INFO, "failed requests/second: %.1f", + result.summary().failed_requests_per_second()); + gpr_log(GPR_INFO, "successful requests/second: %.1f", + result.summary().successful_requests_per_second()); + } } void GprLogReporter::ReportQPSPerCore(const ScenarioResult& result) {