Skip to content

Commit

Permalink
[test] Allow set request/response size in interop soak test
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanli-ml committed Aug 8, 2023
1 parent ca1677f commit 61ad2da
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
11 changes: 8 additions & 3 deletions test/cpp/interop/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ ABSL_FLAG(int32_t, soak_min_time_ms_between_rpcs, 0,
ABSL_FLAG(int32_t, iteration_interval, 10,
"The interval in seconds between rpcs. This is used by "
"long_connection test");
ABSL_FLAG(int32_t, soak_request_size, 271828, "The request size in a soak RPC");
ABSL_FLAG(int32_t, soak_response_size, 314159,
"The response size in a soak RPC");
ABSL_FLAG(
int32_t, soak_request_size, 271828,
"The request size in a soak RPC. "
"The default value is set based on the interop large unary test case.");
ABSL_FLAG(
int32_t, soak_response_size, 314159,
"The response size in a soak RPC. "
"The default value is set based on the interop large unary test case.");
ABSL_FLAG(std::string, additional_metadata, "",
"Additional metadata to send in each request, as a "
"semicolon-separated list of key:value pairs.");
Expand Down
6 changes: 2 additions & 4 deletions test/cpp/interop/interop_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,13 @@ class InteropClient {
int32_t max_failures,
int64_t max_acceptable_per_iteration_latency_ms,
int32_t soak_min_time_ms_between_rpcs,
int32_t overall_timeout_seconds,
int32_t request_size,
int32_t overall_timeout_seconds, int32_t request_size,
int32_t response_size);
bool DoRpcSoakTest(const std::string& server_uri, int32_t soak_iterations,
int32_t max_failures,
int64_t max_acceptable_per_iteration_latency_ms,
int32_t soak_min_time_ms_between_rpcs,
int32_t overall_timeout_seconds,
int32_t request_size,
int32_t overall_timeout_seconds, int32_t request_size,
int32_t response_size);
bool DoLongLivedChannelTest(int32_t soak_iterations,
int32_t iteration_interval);
Expand Down
15 changes: 10 additions & 5 deletions test/cpp/interop/xds_federation_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ ABSL_FLAG(
ABSL_FLAG(int32_t, soak_min_time_ms_between_rpcs, 0,
"The minimum time in milliseconds between consecutive RPCs in a soak "
"test (rpc_soak or channel_soak), useful for limiting QPS");
ABSL_FLAG(int32_t, soak_request_size, 271828, "The request size in a soak RPC");
ABSL_FLAG(int32_t, soak_response_size, 314159,
"The response size in a soak RPC");
ABSL_FLAG(
int32_t, soak_request_size, 271828,
"The request size in a soak RPC. "
"The default value is set based on the interop large unary test case.");
ABSL_FLAG(
int32_t, soak_response_size, 314159,
"The response size in a soak RPCi. "
"The default value is set based on the interop large unary test case.");
ABSL_FLAG(std::string, test_case, "rpc_soak",
"Configure different test cases. Valid options are: "
"rpc_soak: sends --soak_iterations large_unary RPCs; "
Expand Down Expand Up @@ -104,7 +109,7 @@ int main(int argc, char** argv) {
absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs),
absl::GetFlag(FLAGS_soak_overall_timeout_seconds),
absl::GetFlag(FLAGS_soak_request_size),
absl::GetFlag(FLAGS_soak_response_size));
absl::GetFlag(FLAGS_soak_response_size));
} else if (test_case == "channel_soak") {
client.DoChannelSoakTest(
uris[i], absl::GetFlag(FLAGS_soak_iterations),
Expand All @@ -113,7 +118,7 @@ int main(int argc, char** argv) {
absl::GetFlag(FLAGS_soak_min_time_ms_between_rpcs),
absl::GetFlag(FLAGS_soak_overall_timeout_seconds),
absl::GetFlag(FLAGS_soak_request_size),
absl::GetFlag(FLAGS_soak_response_size));
absl::GetFlag(FLAGS_soak_response_size));
} else {
gpr_log(GPR_ERROR,
"Invalid test case, must be either rpc_soak or channel_soak");
Expand Down

0 comments on commit 61ad2da

Please sign in to comment.