|
|
|
@ -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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|