Improvements to reporting mechanism based on comments.
Turned the reporter into a composite, much cleaner arch.
diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc
index 1f17424..2e491ee 100644
--- a/test/cpp/qps/qps_driver.cc
+++ b/test/cpp/qps/qps_driver.cc
@@ -74,8 +74,7 @@
namespace grpc {
namespace testing {
-static void QpsDriver(
- const std::vector<std::unique_ptr<Reporter> >& reporters) {
+static void QpsDriver() {
RpcType rpc_type;
GPR_ASSERT(RpcType_Parse(FLAGS_rpc_type, &rpc_type));
@@ -112,12 +111,10 @@
client_config, FLAGS_num_clients, server_config, FLAGS_num_servers,
FLAGS_warmup_seconds, FLAGS_benchmark_seconds, FLAGS_local_workers);
- for (const auto& reporter : reporters) {
- reporter->ReportQPS(result);
- reporter->ReportQPSPerCore(result, server_config);
- reporter->ReportLatency(result);
- reporter->ReportTimes(result);
- }
+ GetReporter()->ReportQPS(result);
+ GetReporter()->ReportQPSPerCore(result, server_config);
+ GetReporter()->ReportLatency(result);
+ GetReporter()->ReportTimes(result);
}
} // namespace testing
@@ -125,10 +122,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::QpsDriver(reporters);
+ grpc::testing::QpsDriver();
return 0;
}