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

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/bisector.py

Issue 2031883002: Initiate the script that takes a snapshot of CPU usage (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: change expectation Created 4 years, 6 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
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import re 6 import re
7 import time 7 import time
8 import urllib 8 import urllib
9 9
10 from . import config_validation 10 from . import config_validation
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 return '\n'.join(lines) 659 return '\n'.join(lines)
660 660
661 def print_result_debug_info(self): 661 def print_result_debug_info(self):
662 """Prints extra debug info at the end of the bisect process.""" 662 """Prints extra debug info at the end of the bisect process."""
663 lines = self._results_debug_message().splitlines() 663 lines = self._results_debug_message().splitlines()
664 # If we emit a null step then add a log to it, the log should be kept 664 # If we emit a null step then add a log to it, the log should be kept
665 # longer than 7 days (which is often needed to debug some issues). 665 # longer than 7 days (which is often needed to debug some issues).
666 self.api.m.step('Debug Info', []) 666 self.api.m.step('Debug Info', [])
667 self.api.m.step.active_result.presentation.logs['Debug Info'] = lines 667 self.api.m.step.active_result.presentation.logs['Debug Info'] = lines
668 668
669 def print_result_debug_info_with_cpu_snapshot(self):
prasadv 2016/06/07 22:00:49 can we rename this method name shorter? "print_cpu
670 """Prints extra debug info with CPU snapshot at the
prasadv 2016/06/07 22:00:49 Function docstring should be of single line summar
671 end of the bisect process."""
672 lines = self._results_debug_message().splitlines()
673 for revision in self.revisions:
674 lines.append(str(revision.snapshot))
675 self.api.m.step('Debug Info with CPU Snapshot', [])
676 self.api.m.step.active_result.presentation.logs[
677 'Debug Info with CPU Snapshot'] = lines
prasadv 2016/06/07 22:00:49 Need 4 space indentation. Or otherwise declare st
678
669 def post_result(self, halt_on_failure=False): 679 def post_result(self, halt_on_failure=False):
670 """Posts bisect results to Perf Dashboard.""" 680 """Posts bisect results to Perf Dashboard."""
671 self.api.m.perf_dashboard.set_default_config() 681 self.api.m.perf_dashboard.set_default_config()
672 self.api.m.perf_dashboard.post_bisect_results( 682 self.api.m.perf_dashboard.post_bisect_results(
673 self.get_result(), halt_on_failure) 683 self.get_result(), halt_on_failure)
674 684
675 def get_revision_to_eval(self): 685 def get_revision_to_eval(self):
676 """Gets the next RevisionState object in the candidate range. 686 """Gets the next RevisionState object in the candidate range.
677 687
678 Returns: 688 Returns:
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 }) 955 })
946 return revision_rows 956 return revision_rows
947 957
948 def _get_build_url(self): 958 def _get_build_url(self):
949 properties = self.api.m.properties 959 properties = self.api.m.properties
950 bot_url = properties.get('buildbotURL', 960 bot_url = properties.get('buildbotURL',
951 'http://build.chromium.org/p/chromium/') 961 'http://build.chromium.org/p/chromium/')
952 builder_name = urllib.quote(properties.get('buildername', '')) 962 builder_name = urllib.quote(properties.get('buildername', ''))
953 builder_number = str(properties.get('buildnumber', '')) 963 builder_number = str(properties.get('buildnumber', ''))
954 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number) 964 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698