diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2016-05-13 13:49:43 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2016-05-13 15:09:32 -0700 |
commit | 37a907e471f9a2e893cb1b95dc2808bb4c57049b (patch) | |
tree | cabed5b026f58e0fb9536c83de0d0f1a24220a17 /tools | |
parent | 9ad288e7e8a05e34bfb2496e13e5c0d58d7d3c36 (diff) |
add support for CLIENT_LANGUAGE setting
Diffstat (limited to 'tools')
-rw-r--r-- | tools/run_tests/performance/scenario_config.py | 10 | ||||
-rwxr-xr-x | tools/run_tests/run_performance_tests.py | 18 |
2 files changed, 26 insertions, 2 deletions
diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 4fe66dff41..44fce6106e 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -81,6 +81,7 @@ def remove_nonproto_fields(scenario): """Remove special-purpose that contains some extra info about the scenario but don't belong to the ScenarioConfig protobuf message""" scenario.pop('CATEGORIES', None) + scenario.pop('CLIENT_LANGUAGE', None) scenario.pop('SERVER_LANGUAGE', None) return scenario @@ -90,6 +91,7 @@ def _ping_pong_scenario(name, rpc_type, secure=True, use_generic_payload=False, use_unconstrained_client=False, + client_language=None, server_language=None, server_core_limit=0, async_server_threads=0, @@ -142,6 +144,9 @@ def _ping_pong_scenario(name, rpc_type, scenario['client_config']['client_channels'] = 1 scenario['client_config']['async_client_threads'] = 1 + if client_language: + # the CLIENT_LANGUAGE field is recognized by run_performance_tests.py + scenario['CLIENT_LANGUAGE'] = client_language if server_language: # the SERVER_LANGUAGE field is recognized by run_performance_tests.py scenario['SERVER_LANGUAGE'] = server_language @@ -277,6 +282,11 @@ class CSharpLanguage: client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', server_language='c++', server_core_limit=1, async_server_threads=1) + yield _ping_pong_scenario( + 'cpp_to_csharp_protobuf_async_unary_qps_unconstrained', rpc_type='UNARY', + client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', + use_unconstrained_client=True, client_language='c++') + def __str__(self): return 'csharp' diff --git a/tools/run_tests/run_performance_tests.py b/tools/run_tests/run_performance_tests.py index a7728e7f7d..181d62bf4a 100755 --- a/tools/run_tests/run_performance_tests.py +++ b/tools/run_tests/run_performance_tests.py @@ -304,7 +304,11 @@ def create_scenarios(languages, workers_by_lang, remote_host=None, regex='.*', # 'SERVER_LANGUAGE' is an indicator for this script to pick # a server in different language. custom_server_lang = scenario_json.get('SERVER_LANGUAGE', None) + custom_client_lang = scenario_json.get('CLIENT_LANGUAGE', None) scenario_json = scenario_config.remove_nonproto_fields(scenario_json) + if custom_server_lang and custom_client_lang: + raise Exception('Cannot set both custom CLIENT_LANGUAGE and SERVER_LANGUAGE' + 'in the same scenario') if custom_server_lang: if not workers_by_lang.get(custom_server_lang, []): print 'Warning: Skipping scenario %s as' % scenario_json['name'] @@ -314,6 +318,16 @@ def create_scenarios(languages, workers_by_lang, remote_host=None, regex='.*', for idx in range(0, scenario_json['num_servers']): # replace first X workers by workers of a different language workers[idx] = workers_by_lang[custom_server_lang][idx] + if custom_client_lang: + if not workers_by_lang.get(custom_client_lang, []): + print 'Warning: Skipping scenario %s as' % scenario_json['name'] + print('CLIENT_LANGUAGE is set to %s yet the language has ' + 'not been selected with -l' % custom_client_lang) + continue + for idx in range(scenario_json['num_servers'], len(workers)): + # replace all client workers by workers of a different language, + # leave num_server workers as they are server workers. + workers[idx] = workers_by_lang[custom_client_lang][idx] scenario = create_scenario_jobspec(scenario_json, workers, remote_host=remote_host, @@ -360,8 +374,8 @@ argp.add_argument('--bq_result_table', default=None, type=str, help='Bigquery "dataset.table" to upload results to.') argp.add_argument('--category', choices=['smoketest','all'], - default='smoketest', - help='Select a category of tests to run. Smoketest runs by default.') + default='all', + help='Select a category of tests to run.') argp.add_argument('--netperf', default=False, action='store_const', |