aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-11-19 09:51:54 -0800
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-11-19 09:51:54 -0800
commit846ae8d9c29d74fe43858c999b1ce2b907ab38f9 (patch)
tree3bba0ae4ebf90057bea703b06085c7050ce26b6b /test/cpp
parentbb2646a234c30c9e85f4caef65998c4dc00bac8e (diff)
parentc5ebbd5b8f401778c07277acca0a97701fa17651 (diff)
Merge pull request #4156 from jtattermusch/perf_testing_polishing
Performance proto polishing
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/qps/async_streaming_ping_pong_test.cc1
-rw-r--r--test/cpp/qps/async_unary_ping_pong_test.cc1
-rw-r--r--test/cpp/qps/driver.cc2
-rw-r--r--test/cpp/qps/histogram.h7
-rw-r--r--test/cpp/qps/qps_driver.cc6
-rw-r--r--test/cpp/qps/qps_openloop_test.cc1
-rw-r--r--test/cpp/qps/qps_test.cc1
-rw-r--r--test/cpp/qps/qps_test_with_poll.cc1
-rw-r--r--test/cpp/qps/secure_sync_unary_ping_pong_test.cc1
-rw-r--r--test/cpp/qps/server_async.cc2
-rw-r--r--test/cpp/qps/server_sync.cc2
-rw-r--r--test/cpp/qps/sync_streaming_ping_pong_test.cc1
-rw-r--r--test/cpp/qps/sync_unary_ping_pong_test.cc1
13 files changed, 23 insertions, 4 deletions
diff --git a/test/cpp/qps/async_streaming_ping_pong_test.cc b/test/cpp/qps/async_streaming_ping_pong_test.cc
index 9fef93a70f..0acdf3affb 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 @@ static void RunAsyncStreamingPingPong() {
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 b4ab0e5d59..d21e116171 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 @@ static void RunAsyncUnaryPingPong() {
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 67bdcb2f32..20dc65046b 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -110,7 +110,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
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 35527d2a2c..b45c769a77 100644
--- a/test/cpp/qps/histogram.h
+++ b/test/cpp/qps/histogram.h
@@ -42,7 +42,9 @@ namespace testing {
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 @@ class Histogram {
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 4c93a042cf..0479e1aff4 100644
--- a/test/cpp/qps/qps_driver.cc
+++ b/test/cpp/qps/qps_driver.cc
@@ -137,8 +137,14 @@ static void QpsDriver() {
// 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 dc88c893bb..51df79ef2f 100644
--- a/test/cpp/qps/qps_openloop_test.cc
+++ b/test/cpp/qps/qps_openloop_test.cc
@@ -59,6 +59,7 @@ static void RunQPS() {
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 89b35cfb05..1f87d18137 100644
--- a/test/cpp/qps/qps_test.cc
+++ b/test/cpp/qps/qps_test.cc
@@ -58,6 +58,7 @@ static void RunQPS() {
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 97da4096ed..dc800092db 100644
--- a/test/cpp/qps/qps_test_with_poll.cc
+++ b/test/cpp/qps/qps_test_with_poll.cc
@@ -62,6 +62,7 @@ static void RunQPS() {
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 df06f7e471..ce9f02cceb 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 @@ static void RunSynchronousUnaryPingPong() {
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 2d922fa615..c151918ce4 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -60,7 +60,7 @@ class AsyncQpsServerTest : public Server {
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 a09b174b7e..3a15bec888 100644
--- a/test/cpp/qps/server_sync.cc
+++ b/test/cpp/qps/server_sync.cc
@@ -89,7 +89,7 @@ class SynchronousServer GRPC_FINAL : public grpc::testing::Server {
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 186afc03f7..dd8c682815 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 @@ static void RunSynchronousStreamingPingPong() {
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 25851833a6..2edb33ef01 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 @@ static void RunSynchronousUnaryPingPong() {
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);