OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Run Performance Test Bisect Tool | 6 """Run Performance Test Bisect Tool |
7 | 7 |
8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py | 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py |
9 script with the parameters specified in run-bisect-perf-regression.cfg. It will | 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will |
10 check out a copy of the depot in a subdirectory 'bisect' of the working | 10 check out a copy of the depot in a subdirectory 'bisect' of the working |
11 directory provided, and run the bisect-perf-regression.py script there. | 11 directory provided, and run the bisect-perf-regression.py script there. |
12 | 12 |
13 """ | 13 """ |
14 | 14 |
15 import imp | 15 import imp |
16 import optparse | 16 import optparse |
17 import os | 17 import os |
18 import platform | 18 import platform |
19 import subprocess | 19 import subprocess |
20 import sys | 20 import sys |
21 import traceback | 21 import traceback |
22 | 22 |
23 from auto_bisect import bisect_utils | 23 from auto_bisect import bisect_utils |
| 24 from auto_bisect import math_utils |
24 | 25 |
25 bisect = imp.load_source('bisect-perf-regression', | 26 bisect = imp.load_source('bisect-perf-regression', |
26 os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), | 27 os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), |
27 'bisect-perf-regression.py')) | 28 'bisect-perf-regression.py')) |
28 | 29 |
29 | 30 |
30 CROS_BOARD_ENV = 'BISECT_CROS_BOARD' | 31 CROS_BOARD_ENV = 'BISECT_CROS_BOARD' |
31 CROS_IP_ENV = 'BISECT_CROS_IP' | 32 CROS_IP_ENV = 'BISECT_CROS_IP' |
32 | 33 |
33 # Default config file names. | 34 # Default config file names. |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 cloud_file_link = [t for t in cloud_file_link.split(' ') | 302 cloud_file_link = [t for t in cloud_file_link.split(' ') |
302 if 'storage.googleapis.com/chromium-telemetry/html-results/' in t] | 303 if 'storage.googleapis.com/chromium-telemetry/html-results/' in t] |
303 assert cloud_file_link, "Couldn't parse url from output." | 304 assert cloud_file_link, "Couldn't parse url from output." |
304 cloud_file_link = cloud_file_link[0] | 305 cloud_file_link = cloud_file_link[0] |
305 else: | 306 else: |
306 cloud_file_link = '' | 307 cloud_file_link = '' |
307 | 308 |
308 # Calculate the % difference in the means of the 2 runs. | 309 # Calculate the % difference in the means of the 2 runs. |
309 percent_diff_in_means = (results_with_patch[0]['mean'] / | 310 percent_diff_in_means = (results_with_patch[0]['mean'] / |
310 max(0.0001, results_without_patch[0]['mean'])) * 100.0 - 100.0 | 311 max(0.0001, results_without_patch[0]['mean'])) * 100.0 - 100.0 |
311 std_err = bisect.CalculatePooledStandardError( | 312 std_err = math_utils.PooledStandardError( |
312 [results_with_patch[0]['values'], results_without_patch[0]['values']]) | 313 [results_with_patch[0]['values'], results_without_patch[0]['values']]) |
313 | 314 |
314 bisect_utils.OutputAnnotationStepClosed() | 315 bisect_utils.OutputAnnotationStepClosed() |
315 bisect_utils.OutputAnnotationStepStart('Results - %.02f +- %0.02f delta' % | 316 bisect_utils.OutputAnnotationStepStart('Results - %.02f +- %0.02f delta' % |
316 (percent_diff_in_means, std_err)) | 317 (percent_diff_in_means, std_err)) |
317 print ' %s %s %s' % (''.center(10, ' '), 'Mean'.center(20, ' '), | 318 print ' %s %s %s' % (''.center(10, ' '), 'Mean'.center(20, ' '), |
318 'Std. Error'.center(20, ' ')) | 319 'Std. Error'.center(20, ' ')) |
319 print ' %s %s %s' % ('Patch'.center(10, ' '), | 320 print ' %s %s %s' % ('Patch'.center(10, ' '), |
320 ('%.02f' % results_with_patch[0]['mean']).center(20, ' '), | 321 ('%.02f' % results_with_patch[0]['mean']).center(20, ' '), |
321 ('%.02f' % results_with_patch[0]['std_err']).center(20, ' ')) | 322 ('%.02f' % results_with_patch[0]['std_err']).center(20, ' ')) |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 config, current_dir, opts.path_to_goma) | 551 config, current_dir, opts.path_to_goma) |
551 | 552 |
552 print ('Error: Could not load config file. Double check your changes to ' | 553 print ('Error: Could not load config file. Double check your changes to ' |
553 'run-bisect-perf-regression.cfg or run-perf-test.cfg for syntax ' | 554 'run-bisect-perf-regression.cfg or run-perf-test.cfg for syntax ' |
554 'errors.\n') | 555 'errors.\n') |
555 return 1 | 556 return 1 |
556 | 557 |
557 | 558 |
558 if __name__ == '__main__': | 559 if __name__ == '__main__': |
559 sys.exit(main()) | 560 sys.exit(main()) |
OLD | NEW |