Skip to content

Commit

Permalink
Change the output of the bisect results to use links to the svn revis…
Browse files Browse the repository at this point in the history
…ion (if available) rather than the git hash.

Example output:

Other regressions may have occurred:
   Depot                                    Range                                   Confidence
  chromium     http://src.chromium.org/viewvc/chrome?view=revision&revision=240333     0%    
  chromium     http://src.chromium.org/viewvc/chrome?view=revision&revision=240379


Tested commits:
         Depot                                        Commit SHA                                    Mean       Std. Error       State    
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240379        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240333        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240303        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240292        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240286        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240283        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240282        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240281        0.00         +-0.00                  
        chromium         http://src.chromium.org/viewvc/chrome?view=revision&revision=240280        0.00         +-0.00                  

Average build time : 0:00:00
Average test time  : 0:00:00


BUG=332989
NOTRY=true

Review URL: https://codereview.chromium.org/134653006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244648 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
simonhatch@chromium.org committed Jan 14, 2014
1 parent b4a269b commit a6ea2a2
Showing 1 changed file with 49 additions and 22 deletions.
71 changes: 49 additions & 22 deletions tools/bisect-perf-regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -2283,6 +2283,20 @@ def _PrintFailedBanner(self, results_dict):
print
self._PrintConfidence(results_dict)

def _GetViewVCLinkFromDepotAndHash(self, cl, depot):
info = self.source_control.QueryRevisionInfo(cl,
self._GetDepotDirectory(depot))
if depot and DEPOT_DEPS_NAME[depot].has_key('viewvc'):
try:
# Format is "git-svn-id: svn://....@123456 <other data>"
svn_line = [i for i in info['body'].splitlines() if 'git-svn-id:' in i]
svn_revision = svn_line[0].split('@')
svn_revision = svn_revision[1].split(' ')[0]
return DEPOT_DEPS_NAME[depot]['viewvc'] + svn_revision
except IndexError:
return ''
return ''

def _PrintRevisionInfo(self, cl, info, depot=None):
# The perf dashboard specifically looks for the string
# "Author : " to parse out who to cc on a bug. If you change the
Expand All @@ -2292,19 +2306,15 @@ def _PrintRevisionInfo(self, cl, info, depot=None):
print 'Author : %s' % info['author']
if not info['email'].startswith(info['author']):
print 'Email : %s' % info['email']
if depot and DEPOT_DEPS_NAME[depot].has_key('viewvc'):
try:
# Format is "git-svn-id: svn://....@123456 <other data>"
svn_line = [i for i in info['body'].splitlines() if 'git-svn-id:' in i]
svn_revision = svn_line[0].split('@')
svn_revision = svn_revision[1].split(' ')[0]
print 'Link : %s' % DEPOT_DEPS_NAME[depot]['viewvc'] + svn_revision
except IndexError:
print
print 'Failed to parse svn revision from body:'
print
print info['body']
print
commit_link = self._GetViewVCLinkFromDepotAndHash(cl, depot)
if commit_link:
print 'Link : %s' % commit_link
else:
print
print 'Failed to parse svn revision from body:'
print
print info['body']
print
print 'Commit : %s' % cl
print 'Date : %s' % info['date']

Expand All @@ -2316,8 +2326,8 @@ def _PrintTestedCommitsTable(self, revision_data_sorted,
print 'Tested commits:'
else:
print 'Partial results:'
print ' %20s %40s %12s %14s %13s' % ('Depot'.center(20, ' '),
'Commit SHA'.center(40, ' '), 'Mean'.center(12, ' '),
print ' %20s %70s %12s %14s %13s' % ('Depot'.center(20, ' '),
'Commit SHA'.center(70, ' '), 'Mean'.center(12, ' '),
'Std. Error'.center(14, ' '), 'State'.center(13, ' '))
state = 0
for current_id, current_data in revision_data_sorted:
Expand Down Expand Up @@ -2347,9 +2357,13 @@ def _PrintTestedCommitsTable(self, revision_data_sorted,
std_error = ('+-%.02f' %
current_data['value']['std_err']).center(14, ' ')
mean = ('%.02f' % current_data['value']['mean']).center(12, ' ')
print ' %20s %40s %12s %14s %13s' % (
current_data['depot'].center(20, ' '), current_id, mean,
std_error, state_str)
cl_link = self._GetViewVCLinkFromDepotAndHash(current_id,
current_data['depot'])
if not cl_link:
cl_link = current_id
print ' %20s %70s %12s %14s %13s' % (
current_data['depot'].center(20, ' '), cl_link.center(70, ' '),
mean, std_error, state_str)

def _PrintReproSteps(self):
print
Expand All @@ -2362,16 +2376,29 @@ def _PrintReproSteps(self):
def _PrintOtherRegressions(self, other_regressions, revision_data):
print
print 'Other regressions may have occurred:'
print ' %8s %82s %10s' % ('Depot'.center(8, ' '),
'Range'.center(82, ' '), 'Confidence'.center(10, ' '))
print ' %8s %70s %10s' % ('Depot'.center(8, ' '),
'Range'.center(70, ' '), 'Confidence'.center(10, ' '))
for regression in other_regressions:
current_id, previous_id, confidence = regression
current_data = revision_data[current_id]
previous_data = revision_data[previous_id]

print ' %8s %s..%s %s' % (
current_data['depot'], current_id, previous_id,
current_link = self._GetViewVCLinkFromDepotAndHash(current_id,
current_data['depot'])
previous_link = self._GetViewVCLinkFromDepotAndHash(previous_id,
previous_data['depot'])

# If we can't map it to a viewable URL, at least show the original hash.
if not current_link:
current_link = current_id
if not previous_link:
previous_link = previous_id

print ' %8s %70s %s' % (
current_data['depot'], current_link,
('%d%%' % confidence).center(10, ' '))
print ' %8s %70s' % (
previous_data['depot'], previous_link)
print

def _PrintStepTime(self, revision_data_sorted):
Expand Down

0 comments on commit a6ea2a2

Please sign in to comment.