diff options
author | David G. Quintas <dgq@google.com> | 2015-06-09 13:41:42 -0700 |
---|---|---|
committer | David G. Quintas <dgq@google.com> | 2015-06-09 13:41:42 -0700 |
commit | cb7bcb1983d7b267d5f7c56dd519131d432c2b43 (patch) | |
tree | 624dd32c43711c07b520c494ec8b44f9d77994e3 /test/cpp/qps | |
parent | 02f9cb2efad9f32962591fedf0fe30675c958912 (diff) | |
parent | e78ee18db55e5f071e25a027b34a2117cbef5fad (diff) |
Merge pull request #1958 from vjpai/qps-proto3
Update QPS test to proto3
Diffstat (limited to 'test/cpp/qps')
-rw-r--r-- | test/cpp/qps/qps_driver.cc | 3 | ||||
-rw-r--r-- | test/cpp/qps/qps_worker.cc | 4 | ||||
-rw-r--r-- | test/cpp/qps/qpstest.proto | 114 |
3 files changed, 64 insertions, 57 deletions
diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc index eceb5103f6..d534846365 100644 --- a/test/cpp/qps/qps_driver.cc +++ b/test/cpp/qps/qps_driver.cc @@ -132,6 +132,9 @@ static void QpsDriver() { pareto->set_alpha(FLAGS_load_param_2); break; } + default: + GPR_ASSERT(false); + break; } ServerConfig server_config; diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc index fb49271991..40cc4cb89b 100644 --- a/test/cpp/qps/qps_worker.cc +++ b/test/cpp/qps/qps_worker.cc @@ -71,6 +71,8 @@ std::unique_ptr<Client> CreateClient(const ClientConfig& config) { return (config.rpc_type() == RpcType::UNARY) ? CreateAsyncUnaryClient(config) : CreateAsyncStreamingClient(config); + default: + abort(); } abort(); } @@ -82,6 +84,8 @@ std::unique_ptr<Server> CreateServer(const ServerConfig& config, return CreateSynchronousServer(config, server_port); case ServerType::ASYNC_SERVER: return CreateAsyncServer(config, server_port); + default: + abort(); } abort(); } diff --git a/test/cpp/qps/qpstest.proto b/test/cpp/qps/qpstest.proto index d977c9b48b..ef1f9451e9 100644 --- a/test/cpp/qps/qpstest.proto +++ b/test/cpp/qps/qpstest.proto @@ -30,92 +30,92 @@ // An integration test service that covers all the method signature permutations // of unary/streaming requests/responses. -syntax = "proto2"; +syntax = "proto3"; package grpc.testing; enum PayloadType { // Compressable text format. - COMPRESSABLE = 1; + COMPRESSABLE = 0; // Uncompressable binary format. - UNCOMPRESSABLE = 2; + UNCOMPRESSABLE = 1; // Randomly chosen from all other formats defined in this enum. - RANDOM = 3; + RANDOM = 2; } message StatsRequest { // run number - optional int32 test_num = 1; + int32 test_num = 1; } message ServerStats { // wall clock time - required double time_elapsed = 1; + double time_elapsed = 1; // user time used by the server process and threads - required double time_user = 2; + double time_user = 2; // server time used by the server process and all threads - required double time_system = 3; + double time_system = 3; } message Payload { // The type of data in body. - optional PayloadType type = 1; + PayloadType type = 1; // Primary contents of payload. - optional bytes body = 2; + bytes body = 2; } message HistogramData { repeated uint32 bucket = 1; - required double min_seen = 2; - required double max_seen = 3; - required double sum = 4; - required double sum_of_squares = 5; - required double count = 6; + double min_seen = 2; + double max_seen = 3; + double sum = 4; + double sum_of_squares = 5; + double count = 6; } enum ClientType { - SYNCHRONOUS_CLIENT = 1; - ASYNC_CLIENT = 2; + SYNCHRONOUS_CLIENT = 0; + ASYNC_CLIENT = 1; } enum ServerType { - SYNCHRONOUS_SERVER = 1; - ASYNC_SERVER = 2; + SYNCHRONOUS_SERVER = 0; + ASYNC_SERVER = 1; } enum RpcType { - UNARY = 1; - STREAMING = 2; + UNARY = 0; + STREAMING = 1; } enum LoadType { - CLOSED_LOOP = 1; - POISSON = 2; - UNIFORM = 3; - DETERMINISTIC = 4; - PARETO = 5; + CLOSED_LOOP = 0; + POISSON = 1; + UNIFORM = 2; + DETERMINISTIC = 3; + PARETO = 4; } message PoissonParams { - optional double offered_load = 1; + double offered_load = 1; } message UniformParams { - optional double interarrival_lo = 1; - optional double interarrival_hi = 2; + double interarrival_lo = 1; + double interarrival_hi = 2; } message DeterministicParams { - optional double offered_load = 1; + double offered_load = 1; } message ParetoParams { - optional double interarrival_base = 1; - optional double alpha = 2; + double interarrival_base = 1; + double alpha = 2; } message LoadParams { @@ -129,17 +129,17 @@ message LoadParams { message ClientConfig { repeated string server_targets = 1; - required ClientType client_type = 2; - optional bool enable_ssl = 3 [default = false]; - required int32 outstanding_rpcs_per_channel = 4; - required int32 client_channels = 5; - required int32 payload_size = 6; + ClientType client_type = 2; + bool enable_ssl = 3; + int32 outstanding_rpcs_per_channel = 4; + int32 client_channels = 5; + int32 payload_size = 6; // only for async client: - optional int32 async_client_threads = 7; - optional RpcType rpc_type = 8 [default = UNARY]; - optional string host = 9; - optional LoadType load_type = 10 [default = CLOSED_LOOP]; - optional LoadParams load_params = 11; + int32 async_client_threads = 7; + RpcType rpc_type = 8; + string host = 9; + LoadType load_type = 10; + LoadParams load_params = 11; } // Request current stats @@ -154,21 +154,21 @@ message ClientArgs { } message ClientStats { - required HistogramData latencies = 1; - required double time_elapsed = 3; - required double time_user = 4; - required double time_system = 5; + HistogramData latencies = 1; + double time_elapsed = 2; + double time_user = 3; + double time_system = 4; } message ClientStatus { - optional ClientStats stats = 1; + ClientStats stats = 1; } message ServerConfig { - required ServerType server_type = 1; - optional int32 threads = 2 [default = 1]; - optional bool enable_ssl = 3 [default = false]; - optional string host = 4; + ServerType server_type = 1; + int32 threads = 2; + bool enable_ssl = 3; + string host = 4; } message ServerArgs { @@ -179,25 +179,25 @@ message ServerArgs { } message ServerStatus { - optional ServerStats stats = 1; - required int32 port = 2; + ServerStats stats = 1; + int32 port = 2; } message SimpleRequest { // Desired payload type in the response from the server. // If response_type is RANDOM, server randomly chooses one from other formats. - optional PayloadType response_type = 1 [default = COMPRESSABLE]; + PayloadType response_type = 1; // Desired payload size in the response from the server. // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 response_size = 2 [default = 0]; + int32 response_size = 2; // Optional input payload sent along with the request. - optional Payload payload = 3; + Payload payload = 3; } message SimpleResponse { - optional Payload payload = 1; + Payload payload = 1; } service TestService { |