| 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 """Performance Test Bisect Tool | 6 """Performance Test Bisect Tool |
| 7 | 7 |
| 8 This script bisects a series of changelists using binary search. It starts at | 8 This script bisects a series of changelists using binary search. It starts at |
| 9 a bad revision where a performance metric has regressed, and asks for a last | 9 a bad revision where a performance metric has regressed, and asks for a last |
| 10 known-good revision. It will then binary search across this revision range by | 10 known-good revision. It will then binary search across this revision range by |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 after_build_time = time.time() | 1616 after_build_time = time.time() |
| 1617 results = self.RunPerformanceTestAndParseResults(command_to_run, | 1617 results = self.RunPerformanceTestAndParseResults(command_to_run, |
| 1618 metric) | 1618 metric) |
| 1619 | 1619 |
| 1620 if results[1] == 0: | 1620 if results[1] == 0: |
| 1621 external_revisions = self.Get3rdPartyRevisionsFromCurrentRevision( | 1621 external_revisions = self.Get3rdPartyRevisionsFromCurrentRevision( |
| 1622 depot, revision) | 1622 depot, revision) |
| 1623 | 1623 |
| 1624 if not external_revisions is None: | 1624 if not external_revisions is None: |
| 1625 return (results[0], results[1], external_revisions, | 1625 return (results[0], results[1], external_revisions, |
| 1626 time.time() - after_build_time, time.time() - | 1626 time.time() - after_build_time, after_build_time - |
| 1627 start_build_time) | 1627 start_build_time) |
| 1628 else: | 1628 else: |
| 1629 return ('Failed to parse DEPS file for external revisions.', | 1629 return ('Failed to parse DEPS file for external revisions.', |
| 1630 BUILD_RESULT_FAIL) | 1630 BUILD_RESULT_FAIL) |
| 1631 else: | 1631 else: |
| 1632 return results | 1632 return results |
| 1633 else: | 1633 else: |
| 1634 return ('Failed to build revision: [%s]' % (str(revision, )), | 1634 return ('Failed to build revision: [%s]' % (str(revision, )), |
| 1635 BUILD_RESULT_FAIL) | 1635 BUILD_RESULT_FAIL) |
| 1636 else: | 1636 else: |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2372 print ' %8s %s..%s %s' % ( | 2372 print ' %8s %s..%s %s' % ( |
| 2373 current_data['depot'], current_id, previous_id, | 2373 current_data['depot'], current_id, previous_id, |
| 2374 ('%d%%' % confidence).center(10, ' ')) | 2374 ('%d%%' % confidence).center(10, ' ')) |
| 2375 print | 2375 print |
| 2376 | 2376 |
| 2377 def _PrintStepTime(self, revision_data_sorted): | 2377 def _PrintStepTime(self, revision_data_sorted): |
| 2378 step_perf_time_avg = 0.0 | 2378 step_perf_time_avg = 0.0 |
| 2379 step_build_time_avg = 0.0 | 2379 step_build_time_avg = 0.0 |
| 2380 step_count = 0.0 | 2380 step_count = 0.0 |
| 2381 for _, current_data in revision_data_sorted: | 2381 for _, current_data in revision_data_sorted: |
| 2382 step_perf_time_avg += current_data['perf_time'] | 2382 if current_data['value']: |
| 2383 step_build_time_avg += current_data['build_time'] | 2383 step_perf_time_avg += current_data['perf_time'] |
| 2384 step_count += 1 | 2384 step_build_time_avg += current_data['build_time'] |
| 2385 step_count += 1 |
| 2385 if step_count: | 2386 if step_count: |
| 2386 step_perf_time_avg = step_perf_time_avg / step_count | 2387 step_perf_time_avg = step_perf_time_avg / step_count |
| 2387 step_build_time_avg = step_build_time_avg / step_count | 2388 step_build_time_avg = step_build_time_avg / step_count |
| 2388 print | 2389 print |
| 2389 print 'Average build time : %s' % datetime.timedelta( | 2390 print 'Average build time : %s' % datetime.timedelta( |
| 2390 seconds=int(step_build_time_avg)) | 2391 seconds=int(step_build_time_avg)) |
| 2391 print 'Average test time : %s' % datetime.timedelta( | 2392 print 'Average test time : %s' % datetime.timedelta( |
| 2392 seconds=int(step_perf_time_avg)) | 2393 seconds=int(step_perf_time_avg)) |
| 2393 | 2394 |
| 2394 def _PrintWarnings(self): | 2395 def _PrintWarnings(self): |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2994 # The perf dashboard scrapes the "results" step in order to comment on | 2995 # The perf dashboard scrapes the "results" step in order to comment on |
| 2995 # bugs. If you change this, please update the perf dashboard as well. | 2996 # bugs. If you change this, please update the perf dashboard as well. |
| 2996 bisect_utils.OutputAnnotationStepStart('Results') | 2997 bisect_utils.OutputAnnotationStepStart('Results') |
| 2997 print 'Error: %s' % e.message | 2998 print 'Error: %s' % e.message |
| 2998 if opts.output_buildbot_annotations: | 2999 if opts.output_buildbot_annotations: |
| 2999 bisect_utils.OutputAnnotationStepClosed() | 3000 bisect_utils.OutputAnnotationStepClosed() |
| 3000 return 1 | 3001 return 1 |
| 3001 | 3002 |
| 3002 if __name__ == '__main__': | 3003 if __name__ == '__main__': |
| 3003 sys.exit(main()) | 3004 sys.exit(main()) |
| OLD | NEW |