Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: tools/bisect-perf-regression.py

Issue 580293002: Add commit position to bisect result output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2629 confidence_status = 'Successful with %(level)s confidence%(warning)s.' 2629 confidence_status = 'Successful with %(level)s confidence%(warning)s.'
2630 if results_dict['confidence'] >= HIGH_CONFIDENCE: 2630 if results_dict['confidence'] >= HIGH_CONFIDENCE:
2631 level = 'high' 2631 level = 'high'
2632 else: 2632 else:
2633 level = 'low' 2633 level = 'low'
2634 warning = ' and warnings' 2634 warning = ' and warnings'
2635 if not self.warnings: 2635 if not self.warnings:
2636 warning = '' 2636 warning = ''
2637 return confidence_status % {'level': level, 'warning': warning} 2637 return confidence_status % {'level': level, 'warning': warning}
2638 2638
2639 def _GetViewVCLinkFromDepotAndHash(self, cl, depot): 2639 def _GetViewVCLinkFromDepotAndHash(self, revision_id, depot):
2640 info = self.source_control.QueryRevisionInfo(cl, 2640 """Gets link to the repository browser."""
2641 self._GetDepotDirectory(depot)) 2641 info = self.source_control.QueryRevisionInfo(
2642 revision_id, self._GetDepotDirectory(depot))
2642 if depot and DEPOT_DEPS_NAME[depot].has_key('viewvc'): 2643 if depot and DEPOT_DEPS_NAME[depot].has_key('viewvc'):
2643 try: 2644 try:
2644 # Format is "git-svn-id: svn://....@123456 <other data>" 2645 # Format is "git-svn-id: svn://....@123456 <other data>"
2645 svn_line = [i for i in info['body'].splitlines() if 'git-svn-id:' in i] 2646 svn_line = [i for i in info['body'].splitlines() if 'git-svn-id:' in i]
2646 svn_revision = svn_line[0].split('@') 2647 svn_revision = svn_line[0].split('@')
2647 svn_revision = svn_revision[1].split(' ')[0] 2648 svn_revision = svn_revision[1].split(' ')[0]
2648 return DEPOT_DEPS_NAME[depot]['viewvc'] + svn_revision 2649 return DEPOT_DEPS_NAME[depot]['viewvc'] + svn_revision
2649 except IndexError: 2650 except IndexError:
2650 return '' 2651 return ''
2651 return '' 2652 return ''
(...skipping 13 matching lines...) Expand all
2665 'author': info['author'], 2666 'author': info['author'],
2666 'email_info': email_info, 2667 'email_info': email_info,
2667 'commit_info': commit_info, 2668 'commit_info': commit_info,
2668 'cl': cl, 2669 'cl': cl,
2669 'cl_date': info['date'] 2670 'cl_date': info['date']
2670 } 2671 }
2671 2672
2672 def _PrintTestedCommitsHeader(self): 2673 def _PrintTestedCommitsHeader(self):
2673 if self.opts.bisect_mode == BISECT_MODE_MEAN: 2674 if self.opts.bisect_mode == BISECT_MODE_MEAN:
2674 _PrintTableRow( 2675 _PrintTableRow(
2675 [20, 70, 14, 12, 13], 2676 [20, 12, 70, 14, 12, 13],
2676 ['Depot', 'Commit SHA', 'Mean', 'Std. Error', 'State']) 2677 ['Depot', 'Position', 'SHA', 'Mean', 'Std. Error', 'State'])
2677 elif self.opts.bisect_mode == BISECT_MODE_STD_DEV: 2678 elif self.opts.bisect_mode == BISECT_MODE_STD_DEV:
2678 _PrintTableRow( 2679 _PrintTableRow(
2679 [20, 70, 14, 12, 13], 2680 [20, 12, 70, 14, 12, 13],
2680 ['Depot', 'Commit SHA', 'Std. Error', 'Mean', 'State']) 2681 ['Depot', 'Position', 'SHA', 'Std. Error', 'Mean', 'State'])
2681 elif self.opts.bisect_mode == BISECT_MODE_RETURN_CODE: 2682 elif self.opts.bisect_mode == BISECT_MODE_RETURN_CODE:
2682 _PrintTableRow( 2683 _PrintTableRow(
2683 [20, 70, 14, 13], 2684 [20, 12, 70, 14, 13],
2684 ['Depot', 'Commit SHA', 'Return Code', 'State']) 2685 ['Depot', 'Position', 'SHA', 'Return Code', 'State'])
2685 else: 2686 else:
2686 assert False, 'Invalid bisect_mode specified.' 2687 assert False, 'Invalid bisect_mode specified.'
2687 2688
2688 def _PrintTestedCommitsEntry(self, current_data, cl_link, state_str): 2689 def _PrintTestedCommitsEntry(self, current_data, commit_position, cl_link,
2690 state_str):
2689 if self.opts.bisect_mode == BISECT_MODE_MEAN: 2691 if self.opts.bisect_mode == BISECT_MODE_MEAN:
2690 std_error = '+-%.02f' % current_data['value']['std_err'] 2692 std_error = '+-%.02f' % current_data['value']['std_err']
2691 mean = '%.02f' % current_data['value']['mean'] 2693 mean = '%.02f' % current_data['value']['mean']
2692 _PrintTableRow( 2694 _PrintTableRow(
2693 [20, 70, 12, 14, 13], 2695 [20, 12, 70, 12, 14, 13],
2694 [current_data['depot'], cl_link, mean, std_error, state_str]) 2696 [current_data['depot'], commit_position, cl_link, mean, std_error,
2697 state_str])
2695 elif self.opts.bisect_mode == BISECT_MODE_STD_DEV: 2698 elif self.opts.bisect_mode == BISECT_MODE_STD_DEV:
2696 std_error = '+-%.02f' % current_data['value']['std_err'] 2699 std_error = '+-%.02f' % current_data['value']['std_err']
2697 mean = '%.02f' % current_data['value']['mean'] 2700 mean = '%.02f' % current_data['value']['mean']
2698 _PrintTableRow( 2701 _PrintTableRow(
2699 [20, 70, 12, 14, 13], 2702 [20, 12, 70, 12, 14, 13],
2700 [current_data['depot'], cl_link, std_error, mean, state_str]) 2703 [current_data['depot'], commit_position, cl_link, std_error, mean,
2704 state_str])
2701 elif self.opts.bisect_mode == BISECT_MODE_RETURN_CODE: 2705 elif self.opts.bisect_mode == BISECT_MODE_RETURN_CODE:
2702 mean = '%d' % current_data['value']['mean'] 2706 mean = '%d' % current_data['value']['mean']
2703 _PrintTableRow( 2707 _PrintTableRow(
2704 [20, 70, 14, 13], 2708 [20, 12, 70, 14, 13],
2705 [current_data['depot'], cl_link, mean, state_str]) 2709 [current_data['depot'], commit_position, cl_link, mean,
2710 state_str])
2706 2711
2707 def _PrintTestedCommitsTable( 2712 def _PrintTestedCommitsTable(
2708 self, revision_data_sorted, first_working_revision, last_broken_revision, 2713 self, revision_data_sorted, first_working_revision, last_broken_revision,
2709 confidence, final_step=True): 2714 confidence, final_step=True):
2710 print 2715 print
2711 if final_step: 2716 if final_step:
2712 print '===== TESTED COMMITS =====' 2717 print '===== TESTED COMMITS ====='
2713 else: 2718 else:
2714 print '===== PARTIAL RESULTS =====' 2719 print '===== PARTIAL RESULTS ====='
2715 self._PrintTestedCommitsHeader() 2720 self._PrintTestedCommitsHeader()
(...skipping 19 matching lines...) Expand all
2735 2740
2736 # If confidence is too low, don't bother outputting good/bad. 2741 # If confidence is too low, don't bother outputting good/bad.
2737 if not confidence: 2742 if not confidence:
2738 state_str = '' 2743 state_str = ''
2739 state_str = state_str.center(13, ' ') 2744 state_str = state_str.center(13, ' ')
2740 2745
2741 cl_link = self._GetViewVCLinkFromDepotAndHash(current_id, 2746 cl_link = self._GetViewVCLinkFromDepotAndHash(current_id,
2742 current_data['depot']) 2747 current_data['depot'])
2743 if not cl_link: 2748 if not cl_link:
2744 cl_link = current_id 2749 cl_link = current_id
2745 self._PrintTestedCommitsEntry(current_data, cl_link, state_str) 2750 commit_position = self.source_control.GetCommitPosition(current_id)
2751 self._PrintTestedCommitsEntry(current_data, commit_position, cl_link,
2752 state_str)
2746 2753
2747 def _PrintReproSteps(self): 2754 def _PrintReproSteps(self):
2748 """Prints out a section of the results explaining how to run the test. 2755 """Prints out a section of the results explaining how to run the test.
2749 2756
2750 This message includes the command used to run the test. 2757 This message includes the command used to run the test.
2751 """ 2758 """
2752 command = '$ ' + self.opts.command 2759 command = '$ ' + self.opts.command
2753 if bisect_utils.IsTelemetryCommand(self.opts.command): 2760 if bisect_utils.IsTelemetryCommand(self.opts.command):
2754 command += ('\nAlso consider passing --profiler=list to see available ' 2761 command += ('\nAlso consider passing --profiler=list to see available '
2755 'profilers.') 2762 'profilers.')
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
3397 # bugs. If you change this, please update the perf dashboard as well. 3404 # bugs. If you change this, please update the perf dashboard as well.
3398 bisect_utils.OutputAnnotationStepStart('Results') 3405 bisect_utils.OutputAnnotationStepStart('Results')
3399 print 'Error: %s' % e.message 3406 print 'Error: %s' % e.message
3400 if opts.output_buildbot_annotations: 3407 if opts.output_buildbot_annotations:
3401 bisect_utils.OutputAnnotationStepClosed() 3408 bisect_utils.OutputAnnotationStepClosed()
3402 return 1 3409 return 1
3403 3410
3404 3411
3405 if __name__ == '__main__': 3412 if __name__ == '__main__':
3406 sys.exit(main()) 3413 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698