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

Unified Diff: scripts/slave/recipe_modules/auto_bisect/revision_state.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: Fix styling inconsistency and bug 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/auto_bisect/revision_state.py
diff --git a/scripts/slave/recipe_modules/auto_bisect/revision_state.py b/scripts/slave/recipe_modules/auto_bisect/revision_state.py
index f6a7d0194b21499f1ecda3ef75b22d95443d9758..8dd203b8fbb0b679086882b0f205caabb2e96844 100644
--- a/scripts/slave/recipe_modules/auto_bisect/revision_state.py
+++ b/scripts/slave/recipe_modules/auto_bisect/revision_state.py
@@ -75,6 +75,7 @@ class RevisionState(object):
self.commit_hash = str(commit_hash)
self._rev_str = None
self.base_revision = base_revision
+ self.snapshot = []
if self.base_revision:
assert self.base_revision.deps_file_contents
self.needs_patch = True
@@ -183,7 +184,7 @@ class RevisionState(object):
return self.bisector.api.m.gitiles.download_file(
repository_url=url, file_path=file_name, branch=branch)
except TypeError:
- print 'Could not read content for %s/%s/%s' % (url, file_name, branch)
+ print 'Could not read content for %s/%s/%s' % (url, file_name, branch)
return None
def read_deps(self, recipe_tester_name):
@@ -490,7 +491,17 @@ class RevisionState(object):
skip_download = self.bisector.last_tested_revision == self
self.bisector.last_tested_revision = self
overrides = perf_test_properties['properties']
- api.run_local_test_run(overrides, skip_download=skip_download)
+ snapshot_result = api.m.step(
+ 'Take a Snapshot of CPU',
+ ['python', api.resource('cpu_usage.py')],
+ stdout=api.m.json.output())
+ process_list = snapshot_result.stdout
+ if process_list:
+ process_list = [str(process) for process in process_list]
+ self.snapshot = process_list
+ api.m.step.active_result.presentation.logs['CPU snapshot'] = \
+ process_list
+ api.run_local_test_run(overrides, skip_download=skip_download)
else:
step_name = 'Triggering test job for ' + self.commit_hash
api.m.trigger(perf_test_properties, name=step_name)
« no previous file with comments | « scripts/slave/recipe_modules/auto_bisect/resources/cpu_usage.py ('k') | scripts/slave/recipes/bisect.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698