Improvements to reporting mechanism based on comments.
Turned the reporter into a composite, much cleaner arch.
diff --git a/test/cpp/qps/qps_test.cc b/test/cpp/qps/qps_test.cc
index 9294079..03c9c2c 100644
--- a/test/cpp/qps/qps_test.cc
+++ b/test/cpp/qps/qps_test.cc
@@ -47,7 +47,7 @@
static const int WARMUP = 5;
static const int BENCHMARK = 10;
-static void RunQPS(const std::vector<std::unique_ptr<Reporter> >& reporters) {
+static void RunQPS() {
gpr_log(GPR_INFO, "Running QPS test");
ClientConfig client_config;
@@ -67,10 +67,8 @@
const auto result =
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
- for (const auto& reporter : reporters) {
- reporter->ReportQPSPerCore(result, server_config);
- reporter->ReportLatency(result);
- }
+ GetReporter()->ReportQPSPerCore(result, server_config);
+ GetReporter()->ReportLatency(result);
}
} // namespace testing
@@ -78,10 +76,9 @@
int main(int argc, char** argv) {
grpc::testing::InitBenchmark(&argc, &argv, true);
- const auto& reporters = grpc::testing::InitBenchmarkReporters();
signal(SIGPIPE, SIG_IGN);
- grpc::testing::RunQPS(reporters);
+ grpc::testing::RunQPS();
return 0;
}