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

Unified Diff: tools/auto_bisect/bisect_perf_regression.py

Issue 1625573004: Update legacy bisect to post results to perf dashboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_import_path
Patch Set: update doc Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: tools/auto_bisect/bisect_perf_regression.py
diff --git a/tools/auto_bisect/bisect_perf_regression.py b/tools/auto_bisect/bisect_perf_regression.py
index 5167b1d3c1a1376fd295b22119de45bfb5a5d7f3..b865c45fa7346253f2bc2034ce9f153d882574f4 100755
--- a/tools/auto_bisect/bisect_perf_regression.py
+++ b/tools/auto_bisect/bisect_perf_regression.py
@@ -41,11 +41,12 @@ try bots, and is started by tools/run-bisect-perf-regression.py using
config parameters from tools/auto_bisect/bisect.cfg.
"""
+import argparse
import copy
import errno
import hashlib
+import json
import logging
-import argparse
import os
import re
import shlex
@@ -53,12 +54,14 @@ import shutil
import StringIO
import sys
import time
+import urllib2
sys.path.append(os.path.join(
os.path.dirname(__file__), os.path.pardir, 'telemetry'))
from bisect_printer import BisectPrinter
from bisect_results import BisectResults
+import bisect_results_json
from bisect_state import BisectState
import bisect_utils
import builder
@@ -124,6 +127,7 @@ PERF_SVN_REPO_URL = 'svn://svn.chromium.org/chrome-try/try-perf'
FULL_SVN_REPO_URL = 'svn://svn.chromium.org/chrome-try/try'
ANDROID_CHROME_SVN_REPO_URL = ('svn://svn.chromium.org/chrome-try-internal/'
'try-perf')
+PERF_DASH_RESULTS_URL = 'https://chromeperf.appspot.com/post_bisect_results'
class RunGitError(Exception):
@@ -2505,6 +2509,24 @@ def _IsPlatformSupported():
return os.name in supported
+def _PostBisectResults(bisect_results, opts, src_cwd):
+ """Posts bisect results to Perf Dashboard."""
+ bisect_utils.OutputAnnotationStepStart('Post Results')
+
+ results = bisect_results_json.get(
+ bisect_results, opts, DepotDirectoryRegistry(src_cwd))
+ data = {'data': results}
+ request = urllib2.Request(PERF_DASH_RESULTS_URL)
+ request.add_header('Content-Type', 'application/json')
+ try:
+ urllib2.urlopen(request, json.dumps(data))
+ except urllib2.URLError as e:
+ print 'Failed to post bisect results. Error: %s.' % e
+ bisect_utils.OutputAnnotationStepWarning()
+
+ bisect_utils.OutputAnnotationStepClosed()
+
+
def RemoveBuildFiles(build_type):
"""Removes build files from previous runs."""
out_dir = os.path.join('out', build_type)
@@ -2584,6 +2606,7 @@ class BisectOptions(object):
self.improvement_direction = 0
self.bug_id = ''
self.required_initial_confidence = 80.0
+ self.try_job_id = None
@staticmethod
def _AddBisectOptionsGroup(parser):
@@ -2858,6 +2881,7 @@ def main():
if results.error:
raise RuntimeError(results.error)
bisect_test.printer.FormatAndPrintResults(results)
+ _PostBisectResults(results, opts, os.getcwd())
return 0
finally:
bisect_test.PerformCleanup()
« no previous file with comments | « no previous file | tools/auto_bisect/bisect_perf_regression_test.py » ('j') | tools/auto_bisect/bisect_perf_regression_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698