use new perf proto options in c++
diff --git a/test/cpp/qps/async_streaming_ping_pong_test.cc b/test/cpp/qps/async_streaming_ping_pong_test.cc
index 9fef93a..0acdf3a 100644
--- a/test/cpp/qps/async_streaming_ping_pong_test.cc
+++ b/test/cpp/qps/async_streaming_ping_pong_test.cc
@@ -58,6 +58,7 @@
ServerConfig server_config;
server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_host("localhost");
server_config.set_async_server_threads(1);
const auto result =
diff --git a/test/cpp/qps/async_unary_ping_pong_test.cc b/test/cpp/qps/async_unary_ping_pong_test.cc
index b4ab0e5..d21e116 100644
--- a/test/cpp/qps/async_unary_ping_pong_test.cc
+++ b/test/cpp/qps/async_unary_ping_pong_test.cc
@@ -58,6 +58,7 @@
ServerConfig server_config;
server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_host("localhost");
server_config.set_async_server_threads(1);
const auto result =
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index 2c6247d..6f84af1 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -110,7 +110,7 @@
list<ClientContext> contexts;
// To be added to the result, containing the final configuration used for
- // client and config (incluiding host, etc.)
+ // client and config (including host, etc.)
ClientConfig result_client_config;
ServerConfig result_server_config;
diff --git a/test/cpp/qps/histogram.h b/test/cpp/qps/histogram.h
index 35527d2..b45c769 100644
--- a/test/cpp/qps/histogram.h
+++ b/test/cpp/qps/histogram.h
@@ -42,7 +42,9 @@
class Histogram {
public:
- Histogram() : impl_(gpr_histogram_create(0.01, 60e9)) {}
+ // TODO: look into making histogram params not hardcoded for C++
+ Histogram() : impl_(gpr_histogram_create(default_resolution(),
+ default_max_possible())) {}
~Histogram() {
if (impl_) gpr_histogram_destroy(impl_);
}
@@ -73,6 +75,9 @@
p.sum_of_squares(), p.count());
}
+ static double default_resolution() { return 0.01; }
+ static double default_max_possible() { return 60e9; }
+
private:
Histogram(const Histogram&);
Histogram& operator=(const Histogram&);
diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc
index 4c93a04..0479e1a 100644
--- a/test/cpp/qps/qps_driver.cc
+++ b/test/cpp/qps/qps_driver.cc
@@ -137,8 +137,14 @@
// No further load parameters to set up for closed loop
}
+ client_config.mutable_histogram_params()->
+ set_resolution(Histogram::default_resolution());
+ client_config.mutable_histogram_params()->
+ set_max_possible(Histogram::default_max_possible());
+
ServerConfig server_config;
server_config.set_server_type(server_type);
+ server_config.set_host("localhost");
server_config.set_async_server_threads(FLAGS_async_server_threads);
if (FLAGS_secure_test) {
diff --git a/test/cpp/qps/qps_openloop_test.cc b/test/cpp/qps/qps_openloop_test.cc
index dc88c89..51df79e 100644
--- a/test/cpp/qps/qps_openloop_test.cc
+++ b/test/cpp/qps/qps_openloop_test.cc
@@ -59,6 +59,7 @@
ServerConfig server_config;
server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_host("localhost");
server_config.set_async_server_threads(4);
const auto result =
diff --git a/test/cpp/qps/qps_test.cc b/test/cpp/qps/qps_test.cc
index 89b35cf..1f87d18 100644
--- a/test/cpp/qps/qps_test.cc
+++ b/test/cpp/qps/qps_test.cc
@@ -58,6 +58,7 @@
ServerConfig server_config;
server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_host("localhost");
server_config.set_async_server_threads(8);
const auto result =
diff --git a/test/cpp/qps/qps_test_with_poll.cc b/test/cpp/qps/qps_test_with_poll.cc
index 97da409..dc80009 100644
--- a/test/cpp/qps/qps_test_with_poll.cc
+++ b/test/cpp/qps/qps_test_with_poll.cc
@@ -62,6 +62,7 @@
ServerConfig server_config;
server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_host("localhost");
server_config.set_async_server_threads(4);
const auto result =
diff --git a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc
index df06f7e..ce9f02c 100644
--- a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc
+++ b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc
@@ -57,6 +57,7 @@
ServerConfig server_config;
server_config.set_server_type(SYNC_SERVER);
+ server_config.set_host("localhost");
// Set up security params
SecurityParams security;
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 2d922fa..c151918 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -60,7 +60,7 @@
explicit AsyncQpsServerTest(const ServerConfig &config) : Server(config) {
char *server_address = NULL;
- gpr_join_host_port(&server_address, "::", port());
+ gpr_join_host_port(&server_address, config.host().c_str(), port());
ServerBuilder builder;
builder.AddListeningPort(server_address,
diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc
index a09b174..3a15bec 100644
--- a/test/cpp/qps/server_sync.cc
+++ b/test/cpp/qps/server_sync.cc
@@ -89,7 +89,7 @@
char* server_address = NULL;
- gpr_join_host_port(&server_address, "::", port());
+ gpr_join_host_port(&server_address, config.host().c_str(), port());
builder.AddListeningPort(server_address,
Server::CreateServerCredentials(config));
gpr_free(server_address);
diff --git a/test/cpp/qps/sync_streaming_ping_pong_test.cc b/test/cpp/qps/sync_streaming_ping_pong_test.cc
index 186afc0..dd8c682 100644
--- a/test/cpp/qps/sync_streaming_ping_pong_test.cc
+++ b/test/cpp/qps/sync_streaming_ping_pong_test.cc
@@ -57,6 +57,7 @@
ServerConfig server_config;
server_config.set_server_type(SYNC_SERVER);
+ server_config.set_host("localhost");
const auto result =
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
diff --git a/test/cpp/qps/sync_unary_ping_pong_test.cc b/test/cpp/qps/sync_unary_ping_pong_test.cc
index 2585183..2edb33e 100644
--- a/test/cpp/qps/sync_unary_ping_pong_test.cc
+++ b/test/cpp/qps/sync_unary_ping_pong_test.cc
@@ -57,6 +57,7 @@
ServerConfig server_config;
server_config.set_server_type(SYNC_SERVER);
+ server_config.set_host("localhost");
const auto result =
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);