| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 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 """Defines various log processors used by buildbot steps. | 6 """Defines various log processors used by buildbot steps. |
| 7 | 7 |
| 8 Current approach is to set an instance of log processor in | 8 Current approach is to set an instance of log processor in |
| 9 the ProcessLogTestStep implementation and it will call process() | 9 the ProcessLogTestStep implementation and it will call process() |
| 10 method upon completion with full data from process stdio. | 10 method upon completion with full data from process stdio. |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 high_perf = (expected['delta'] + 1.5*expected['var']) | 259 high_perf = (expected['delta'] + 1.5*expected['var']) |
| 260 low_perf = (expected['delta'] - 1.5*expected['var']) | 260 low_perf = (expected['delta'] - 1.5*expected['var']) |
| 261 high_var = 1.5*expected['var'] | 261 high_var = 1.5*expected['var'] |
| 262 low_var = 0.5*expected['var'] | 262 low_var = 0.5*expected['var'] |
| 263 | 263 |
| 264 if actual['delta'] > high_perf: | 264 if actual['delta'] > high_perf: |
| 265 self._perf_regress.append(graph_result) | 265 self._perf_regress.append(graph_result) |
| 266 elif actual['delta'] < low_perf: | 266 elif actual['delta'] < low_perf: |
| 267 self._perf_improve.append(graph_result) | 267 self._perf_improve.append(graph_result) |
| 268 | 268 |
| 269 if actual['var'] > high_var: | |
| 270 self._var_regress.append(graph_result) | |
| 271 elif actual['var'] < low_var: | |
| 272 self._var_improve.append(graph_result) | |
| 273 | |
| 274 def PerformanceChanges(self): | 269 def PerformanceChanges(self): |
| 275 # Load performance expectations for this test. | 270 # Load performance expectations for this test. |
| 276 self.LoadPerformanceExpectations() | 271 self.LoadPerformanceExpectations() |
| 277 | 272 |
| 278 # Compare actual and expected results. | 273 # Compare actual and expected results. |
| 279 for graph_name in self._actual_performance: | 274 for graph_name in self._actual_performance: |
| 280 for result_type in self._actual_performance[graph_name]: | 275 for result_type in self._actual_performance[graph_name]: |
| 281 self.ComparePerformance(graph_name, result_type) | 276 self.ComparePerformance(graph_name, result_type) |
| 282 | 277 |
| 283 return self.PerformanceChangesAsText() | 278 return self.PerformanceChangesAsText() |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 FormatFloat(mean), | 788 FormatFloat(mean), |
| 794 FormatFloat(stddev), | 789 FormatFloat(stddev), |
| 795 self._JoinWithSpacesAndNewLine(times))) | 790 self._JoinWithSpacesAndNewLine(times))) |
| 796 | 791 |
| 797 filename = os.path.join(self._output_dir, | 792 filename = os.path.join(self._output_dir, |
| 798 '%s_%s.dat' % (self._revision, trace_name)) | 793 '%s_%s.dat' % (self._revision, trace_name)) |
| 799 file = open(filename, 'w') | 794 file = open(filename, 'w') |
| 800 file.write(''.join(file_data)) | 795 file.write(''.join(file_data)) |
| 801 file.close() | 796 file.close() |
| 802 os.chmod(filename, READABLE_FILE_PERMISSIONS) | 797 os.chmod(filename, READABLE_FILE_PERMISSIONS) |
| OLD | NEW |