aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-05-23 11:10:16 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-05-23 11:10:16 -0700
commit73cb476b0b0ea58fa71e0a1399a61cee17efa45e (patch)
tree65697383b6c46bb859d899227189e7aa0a94e6b4 /test
parent2d655690893b8cfd54f802bf95793b1c1734b599 (diff)
parentfdf2a66499d00c0887b78ed7071f34fa80cbcad9 (diff)
Merge github.com:grpc/grpc into error
Diffstat (limited to 'test')
-rwxr-xr-xtest/cpp/qps/gen_build_yaml.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/cpp/qps/gen_build_yaml.py b/test/cpp/qps/gen_build_yaml.py
index 6b3329b046..e8ad74f0f6 100755
--- a/test/cpp/qps/gen_build_yaml.py
+++ b/test/cpp/qps/gen_build_yaml.py
@@ -46,6 +46,24 @@ import performance.scenario_config as scenario_config
def _scenario_json_string(scenario_json):
return json.dumps(scenario_config.remove_nonproto_fields(scenario_json))
+def threads_of_type(scenario_json, path):
+ d = scenario_json
+ for el in path.split('/'):
+ if el not in d:
+ return 0
+ d = d[el]
+ return d
+
+def guess_cpu(scenario_json):
+ client = threads_of_type(scenario_json, 'client_config/async_client_threads')
+ server = threads_of_type(scenario_json, 'server_config/async_server_threads')
+ # make an arbitrary guess if set to auto-detect
+ # about the size of the jenkins instances we have for unit tests
+ if client == 0: client = 8
+ if server == 0: server = 8
+ return (scenario_json['num_clients'] * client +
+ scenario_json['num_servers'] * server)
+
print yaml.dump({
'tests': [
{
@@ -59,7 +77,7 @@ print yaml.dump({
'language': 'c++',
'boringssl': True,
'defaults': 'boringssl',
- 'cpu_cost': 1000.0,
+ 'cpu_cost': guess_cpu(scenario_json),
'exclude_configs': []
}
for scenario_json in scenario_config.CXXLanguage().scenarios()