diff options
author | 2016-05-22 21:17:08 -0400 | |
---|---|---|
committer | 2016-05-22 21:17:08 -0400 | |
commit | b90e6c9b4aec2177994a7400f888972298032ad8 (patch) | |
tree | 2ef11be0a904fbe6c0cfbaaee9d3f3bec8ed316f | |
parent | 336292d2f38b9883e2002f1f1c89704b971d62a6 (diff) | |
parent | bd24a4611f1a827f2da050c8bf6bf4f9216c9aae (diff) |
Merge pull request #6670 from ctiller/guess_cpu
Better guesses at benchmarks turned unit tests cpu cost
-rwxr-xr-x | test/cpp/qps/gen_build_yaml.py | 20 | ||||
-rw-r--r-- | tools/run_tests/tests.json | 32 |
2 files changed, 35 insertions, 17 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() diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index a9fffd33b4..a2eebf8f95 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -23031,7 +23031,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23057,7 +23057,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23083,7 +23083,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23109,7 +23109,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23135,7 +23135,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 8, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23161,7 +23161,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 8, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23187,7 +23187,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 8, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23213,7 +23213,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 1, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23291,7 +23291,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23317,7 +23317,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23343,7 +23343,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23369,7 +23369,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 2, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23395,7 +23395,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 8, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23421,7 +23421,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 8, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23447,7 +23447,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 8, "defaults": "boringssl", "exclude_configs": [], "flaky": false, @@ -23473,7 +23473,7 @@ "posix", "windows" ], - "cpu_cost": 1000.0, + "cpu_cost": 1, "defaults": "boringssl", "exclude_configs": [], "flaky": false, |