address review comments for #27622 (#27659)

pull/27675/head
Jan Tattermusch 3 years ago committed by GitHub
parent 5e69ded6f5
commit aae25e2443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/cpp/qps/json_run_localhost_scenario_gen.py
  2. 2
      test/cpp/qps/qps_json_driver_scenario_gen.py
  3. 7
      test/cpp/qps/scenario_generator_helper.py

@ -17,7 +17,7 @@
import os
import sys
script_dir = os.path.dirname(sys.argv[0])
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(script_dir)
import scenario_generator_helper as gen

@ -17,7 +17,7 @@
import os
import sys
script_dir = os.path.dirname(sys.argv[0])
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(script_dir)
import scenario_generator_helper as gen

@ -45,6 +45,7 @@ _COPYRIGHT = """# Copyright 2021 The gRPC Authors
def _mutate_scenario(scenario_json):
"""Modifies vanilla benchmark scenario config to make it more suitable for running as a unit test."""
# tweak parameters to get fast test times
scenario_json = dict(scenario_json)
scenario_json['warmup_seconds'] = 0
@ -53,11 +54,11 @@ def _mutate_scenario(scenario_json):
if scenario_json['client_config'][
'client_type'] == 'SYNC_CLIENT' or scenario_json['server_config'][
'server_type'] == 'SYNC_SERVER':
# reduce the number of threads needed for scenarios that use synchronous API
outstanding_rpcs_divisor = 10
scenario_json['client_config']['outstanding_rpcs_per_channel'] = max(
1,
int(scenario_json['client_config']['outstanding_rpcs_per_channel'] /
outstanding_rpcs_divisor))
1, scenario_json['client_config']['outstanding_rpcs_per_channel'] //
outstanding_rpcs_divisor)
return scenario_config.remove_nonproto_fields(scenario_json)

Loading…
Cancel
Save