aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/sync_streaming_ping_pong_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/qps/sync_streaming_ping_pong_test.cc')
-rw-r--r--test/cpp/qps/sync_streaming_ping_pong_test.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/cpp/qps/sync_streaming_ping_pong_test.cc b/test/cpp/qps/sync_streaming_ping_pong_test.cc
index ddc1573bfd..b17a3f6e48 100644
--- a/test/cpp/qps/sync_streaming_ping_pong_test.cc
+++ b/test/cpp/qps/sync_streaming_ping_pong_test.cc
@@ -39,6 +39,7 @@
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h"
+#include "test/cpp/util/benchmark_config.h"
namespace grpc {
namespace testing {
@@ -46,12 +47,10 @@ namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
-static void RunSynchronousStreamingPingPong() {
+static void RunSynchronousStreamingPingPong(
+ const std::vector<std::unique_ptr<Reporter> >& reporters) {
gpr_log(GPR_INFO, "Running Synchronous Streaming Ping Pong");
- ReportersRegistry reporters_registry;
- reporters_registry.Register(new GprLogReporter("LogReporter"));
-
ClientConfig client_config;
client_config.set_client_type(SYNCHRONOUS_CLIENT);
client_config.set_enable_ssl(false);
@@ -71,16 +70,19 @@ static void RunSynchronousStreamingPingPong() {
std::set<ReportType> types;
types.insert(grpc::testing::ReportType::REPORT_QPS);
types.insert(grpc::testing::ReportType::REPORT_LATENCY);
- reporters_registry.Report({client_config, server_config, result}, types);
-
+ for (const auto& reporter : reporters) {
+ reporter->Report({client_config, server_config, result}, types);
+ }
}
-
} // namespace testing
} // namespace grpc
int main(int argc, char** argv) {
+ grpc::testing::InitBenchmark(&argc, &argv, true);
+ const auto& reporters = grpc::testing::InitBenchmarkReporters();
+
signal(SIGPIPE, SIG_IGN);
- grpc::testing::RunSynchronousStreamingPingPong();
+ grpc::testing::RunSynchronousStreamingPingPong(reporters);
return 0;
}