diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/qps/async_streaming_ping_pong_test.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/async_unary_ping_pong_test.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/driver.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/histogram.h | 7 | ||||
-rw-r--r-- | test/cpp/qps/qps_driver.cc | 6 | ||||
-rw-r--r-- | test/cpp/qps/qps_openloop_test.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/qps_test.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/qps_test_with_poll.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/secure_sync_unary_ping_pong_test.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/server_async.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/server_sync.cc | 2 | ||||
-rw-r--r-- | test/cpp/qps/sync_streaming_ping_pong_test.cc | 1 | ||||
-rw-r--r-- | test/cpp/qps/sync_unary_ping_pong_test.cc | 1 | ||||
-rw-r--r-- | test/proto/benchmarks/control.proto | 2 | ||||
-rw-r--r-- | test/proto/benchmarks/stats.proto | 17 |
15 files changed, 39 insertions, 7 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); diff --git a/test/proto/benchmarks/control.proto b/test/proto/benchmarks/control.proto index 966ab78baa..962bd2f8cc 100644 --- a/test/proto/benchmarks/control.proto +++ b/test/proto/benchmarks/control.proto @@ -97,6 +97,7 @@ message ClientConfig { RpcType rpc_type = 8; LoadParams load_params = 10; PayloadConfig payload_config = 11; + HistogramParams histogram_params = 12; } message ClientStatus { @@ -118,6 +119,7 @@ message ClientArgs { message ServerConfig { ServerType server_type = 1; SecurityParams security_params = 2; + string host = 3; int32 port = 4; // only for async server int32 async_server_threads = 7; diff --git a/test/proto/benchmarks/stats.proto b/test/proto/benchmarks/stats.proto index d52144f321..194db47caa 100644 --- a/test/proto/benchmarks/stats.proto +++ b/test/proto/benchmarks/stats.proto @@ -32,16 +32,24 @@ syntax = "proto3"; package grpc.testing; message ServerStats { - // wall clock time + // wall clock time change since last reset double time_elapsed = 1; - // user time used by the server process and threads + // change in user time used by the server since last reset double time_user = 2; - // server time used by the server process and all threads + // change in server time used by the server process and all threads since + // last reset double time_system = 3; } +// Histogram params based on grpc/support/histogram.c +message HistogramParams { + double resolution = 1; // first bucket is [0, 1 + resolution) + double max_possible = 2; // use enough buckets to allow this value +} + +// Histogram data based on grpc/support/histogram.c message HistogramData { repeated uint32 bucket = 1; double min_seen = 2; @@ -52,7 +60,10 @@ message HistogramData { } message ClientStats { + // Latency histogram. Data points are in nanoseconds. HistogramData latencies = 1; + + // See ServerStats for details. double time_elapsed = 2; double time_user = 3; double time_system = 4; |