Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Runs perf tests. | 5 """Runs perf tests. |
| 6 | 6 |
| 7 Our buildbot infrastructure requires each slave to run steps serially. | 7 Our buildbot infrastructure requires each slave to run steps serially. |
| 8 This is sub-optimal for android, where these steps can run independently on | 8 This is sub-optimal for android, where these steps can run independently on |
| 9 multiple connected devices. | 9 multiple connected devices. |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 persisted_result = pickle.loads(f.read()) | 74 persisted_result = pickle.loads(f.read()) |
| 75 logging.info('*' * 80) | 75 logging.info('*' * 80) |
| 76 logging.info('Output from:') | 76 logging.info('Output from:') |
| 77 logging.info(persisted_result['cmd']) | 77 logging.info(persisted_result['cmd']) |
| 78 logging.info('*' * 80) | 78 logging.info('*' * 80) |
| 79 print persisted_result['output'] | 79 print persisted_result['output'] |
| 80 | 80 |
| 81 return persisted_result['exit_code'] | 81 return persisted_result['exit_code'] |
| 82 | 82 |
| 83 | 83 |
| 84 def PrintSummary(test_names): | |
| 85 logging.info('*' * 80) | |
| 86 logging.info('Sharding summary') | |
| 87 total_time = 0 | |
| 88 for test_name in test_names: | |
| 89 file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) | |
| 90 if not os.path.exists(file_name): | |
| 91 continue | |
|
rmcilroy
2014/02/14 15:48:40
Do we want to print something out here (e.g., "<te
bulach
2014/02/14 16:08:13
good one! done.
| |
| 92 with file(file_name, 'r') as f: | |
| 93 result = pickle.loads(f.read()) | |
| 94 logging.info('%s : exit_code=%d in %d secs at %s', | |
| 95 result['name'], result['exit_code'], result['total_time'], | |
| 96 result['device']) | |
| 97 total_time += result['total_time'] | |
| 98 logging.info('Total steps time: %d secs', total_time) | |
| 99 | |
| 100 | |
| 84 class _HeartBeatLogger(object): | 101 class _HeartBeatLogger(object): |
| 85 # How often to print the heartbeat on flush(). | 102 # How often to print the heartbeat on flush(). |
| 86 _PRINT_INTERVAL = 30.0 | 103 _PRINT_INTERVAL = 30.0 |
| 87 | 104 |
| 88 def __init__(self): | 105 def __init__(self): |
| 89 """A file-like class for keeping the buildbot alive.""" | 106 """A file-like class for keeping the buildbot alive.""" |
| 90 self._len = 0 | 107 self._len = 0 |
| 91 self._tick = time.time() | 108 self._tick = time.time() |
| 92 self._stopped = threading.Event() | 109 self._stopped = threading.Event() |
| 93 self._timer = threading.Thread(target=self._runner) | 110 self._timer = threading.Thread(target=self._runner) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 Returns: | 246 Returns: |
| 230 A tuple of (TestRunResults, retry). | 247 A tuple of (TestRunResults, retry). |
| 231 """ | 248 """ |
| 232 output, result_type = self._LaunchPerfTest(test_name) | 249 output, result_type = self._LaunchPerfTest(test_name) |
| 233 results = base_test_result.TestRunResults() | 250 results = base_test_result.TestRunResults() |
| 234 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 251 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
| 235 retry = None | 252 retry = None |
| 236 if not results.DidRunPass(): | 253 if not results.DidRunPass(): |
| 237 retry = test_name | 254 retry = test_name |
| 238 return results, retry | 255 return results, retry |
| OLD | NEW |