Refactored benchmark reporting mechanism.
It now allows pluggging in "reporter" instances to process the benchmark results arbitrarily.
This would allow, for example, to send results to a leaderboard and/or other systems for tracking performance metrics.
diff --git a/test/cpp/qps/qps_test.cc b/test/cpp/qps/qps_test.cc
index f567e4c..2f72519 100644
--- a/test/cpp/qps/qps_test.cc
+++ b/test/cpp/qps/qps_test.cc
@@ -31,6 +31,8 @@
*
*/
+#include <set>
+
#include <grpc/support/log.h>
#include <signal.h>
@@ -47,6 +49,9 @@
static void RunQPS() {
gpr_log(GPR_INFO, "Running QPS test");
+ ReportersRegistry reporters_registry;
+ reporters_registry.Register(new GprLogReporter("LogReporter"));
+
ClientConfig client_config;
client_config.set_client_type(ASYNC_CLIENT);
client_config.set_enable_ssl(false);
@@ -64,8 +69,11 @@
const auto result =
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
- ReportQPSPerCore(result, server_config);
- ReportLatency(result);
+ std::set<ReportType> types;
+ types.insert(grpc::testing::ReportType::REPORT_QPS_PER_CORE);
+ types.insert(grpc::testing::ReportType::REPORT_LATENCY);
+ reporters_registry.Report({client_config, server_config, result}, types);
+
}
} // namespace testing