OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """ Check for regressions in bench data. """ | 6 """ Check for regressions in bench data. """ |
7 | 7 |
8 from build_step import BuildStep | 8 from build_step import BuildStep |
9 from utils import shell_utils | 9 from utils import shell_utils |
10 | 10 |
11 import os | 11 import os |
12 import sys | 12 import sys |
13 | 13 |
14 | 14 |
15 class CheckForRegressions(BuildStep): | 15 class CheckForRegressions(BuildStep): |
16 def __init__(self, timeout=600, no_output_timeout=600, **kwargs): | 16 def __init__(self, timeout=600, no_output_timeout=600, **kwargs): |
17 super(CheckForRegressions, self).__init__( | 17 super(CheckForRegressions, self).__init__( |
18 timeout=timeout, | 18 timeout=timeout, |
19 no_output_timeout=no_output_timeout, | 19 no_output_timeout=no_output_timeout, |
20 **kwargs) | 20 **kwargs) |
21 | 21 |
22 def _RunInternal(self, representation): | 22 def _RunInternal(self, representation): |
23 path_to_bench_graph_svg = os.path.join('bench', 'bench_graph_svg.py') | 23 path_to_check_bench_regressions = os.path.join('bench', |
| 24 'check_bench_regressions.py') |
24 path_to_bench_expectations = os.path.join('bench', | 25 path_to_bench_expectations = os.path.join('bench', |
25 'bench_expectations_%s.txt' % self._builder_name) | 26 'bench_expectations_%s.txt' % self._builder_name) |
26 if not os.path.isfile(path_to_bench_expectations): | 27 if not os.path.isfile(path_to_bench_expectations): |
27 print 'Skip due to missing expectations: %s' % path_to_bench_expectations | 28 print 'Skip due to missing expectations: %s' % path_to_bench_expectations |
28 return | 29 return |
29 graph_title = 'Bench_Performance_for_%s' % self._builder_name | 30 cmd = ['python', path_to_check_bench_regressions, |
30 cmd = ['python', path_to_bench_graph_svg, | 31 '-a', representation, |
| 32 '-b', self._builder_name, |
31 '-d', self._perf_data_dir, | 33 '-d', self._perf_data_dir, |
32 '-e', path_to_bench_expectations, | 34 '-e', path_to_bench_expectations, |
33 '-r', '-1', | 35 '-r', self._got_revision, |
34 '-f', '-1', | |
35 '-l', graph_title, | |
36 '-m', representation, | |
37 ] | 36 ] |
38 if self._builder_name.find('_Win') >= 0: | |
39 cmd.extend(['-i', 'c']) # Ignore cpu time for Windows. | |
40 | 37 |
41 shell_utils.Bash(cmd) | 38 shell_utils.Bash(cmd) |
42 | 39 |
43 def _Run(self): | 40 def _Run(self): |
44 if self._perf_data_dir: | 41 if self._perf_data_dir: |
45 self._RunInternal('25th') | 42 self._RunInternal('25th') |
46 | 43 |
47 | 44 |
48 if '__main__' == __name__: | 45 if '__main__' == __name__: |
49 sys.exit(BuildStep.RunBuildStep(CheckForRegressions)) | 46 sys.exit(BuildStep.RunBuildStep(CheckForRegressions)) |
OLD | NEW |