aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/qps_json_driver.cc
diff options
context:
space:
mode:
authorGravatar Hope Casey-Allen <hcaseyal@google.com>2018-08-23 15:14:51 -0700
committerGravatar Hope Casey-Allen <hcaseyal@google.com>2018-08-25 18:33:11 -0700
commit839a0520a2d53a220103aed68bbbe95dfd3aba05 (patch)
tree20c24ebd2ec23018850609b5cd93c8f0f7d2b2b5 /test/cpp/qps/qps_json_driver.cc
parent98fd5a73c3bf1aa285f58932e76bfeaaf5766786 (diff)
Add an option to collect medians every epoch. Useful for gathering per second median latencies
Diffstat (limited to 'test/cpp/qps/qps_json_driver.cc')
-rw-r--r--test/cpp/qps/qps_json_driver.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc
index 0ff692255c..c95e0df251 100644
--- a/test/cpp/qps/qps_json_driver.cc
+++ b/test/cpp/qps/qps_json_driver.cc
@@ -66,6 +66,11 @@ DEFINE_string(json_file_out, "", "File to write the JSON output to.");
DEFINE_string(credential_type, grpc::testing::kInsecureCredentialsType,
"Credential type for communication with workers");
DEFINE_bool(run_inproc, false, "Perform an in-process transport test");
+DEFINE_int32(
+ median_latency_collection_interval_millis, 0,
+ "Specifies the period between gathering latency medians in "
+ "milliseconds. The medians will be logged out on the client at the "
+ "end of the benchmark run. If 0, this periodic collection is disabled.");
namespace grpc {
namespace testing {
@@ -73,13 +78,13 @@ namespace testing {
static std::unique_ptr<ScenarioResult> RunAndReport(const Scenario& scenario,
bool* success) {
std::cerr << "RUNNING SCENARIO: " << scenario.name() << "\n";
- auto result =
- RunScenario(scenario.client_config(), scenario.num_clients(),
- scenario.server_config(), scenario.num_servers(),
- scenario.warmup_seconds(), scenario.benchmark_seconds(),
- !FLAGS_run_inproc ? scenario.spawn_local_worker_count() : -2,
- FLAGS_qps_server_target_override, FLAGS_credential_type,
- FLAGS_run_inproc);
+ auto result = RunScenario(
+ scenario.client_config(), scenario.num_clients(),
+ scenario.server_config(), scenario.num_servers(),
+ scenario.warmup_seconds(), scenario.benchmark_seconds(),
+ !FLAGS_run_inproc ? scenario.spawn_local_worker_count() : -2,
+ FLAGS_qps_server_target_override, FLAGS_credential_type, FLAGS_run_inproc,
+ FLAGS_median_latency_collection_interval_millis);
// Amend the result with scenario config. Eventually we should adjust
// RunScenario contract so we don't need to touch the result here.
@@ -145,7 +150,8 @@ static double SearchOfferedLoad(double initial_offered_load,
bool* success) {
std::cerr << "RUNNING SCENARIO: " << scenario->name() << "\n";
double current_offered_load = initial_offered_load;
- double current_cpu_load = GetCpuLoad(scenario, current_offered_load, success);
+ double current_cpu_load =
+ GetCpuLoad(scenario, current_offered_load, success);
if (current_cpu_load > targeted_cpu_load) {
gpr_log(GPR_ERROR, "Initial offered load too high");
return -1;