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

Unified Diff: scripts/master/status_logger.py

Issue 1507993003: status_logger: record step data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | scripts/master/unittests/status_logger_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/status_logger.py
diff --git a/scripts/master/status_logger.py b/scripts/master/status_logger.py
index 6d0b7e03412ddfb4e4bc699297fa5a51d708c6cb..98d51522000e25f4e987b38921af914243e179ab 100644
--- a/scripts/master/status_logger.py
+++ b/scripts/master/status_logger.py
@@ -186,7 +186,7 @@ class StatusEventLogger(StatusReceiverMultiService):
def send_build_result(
self, scheduled, started, finished, builder_name, bot_name, result,
- project_id=None, subproject_tag=None):
+ project_id=None, subproject_tag=None, steps=None):
"""Log a build result for ts_mon.
This allows computing metrics for builds in mastermon.
@@ -204,6 +204,8 @@ class StatusEventLogger(StatusReceiverMultiService):
d['project_id'] = project_id
if subproject_tag:
d['subproject_tag'] = subproject_tag
+ if steps:
+ d['steps'] = steps
Adrian Kuegel 2015/12/08 11:36:08 I am wondering if this will work. I haven't seen a
self.ts_mon_logger.info(json.dumps(d))
def send_build_event(self, timestamp_kind, timestamp, build_event_type,
@@ -492,6 +494,15 @@ class StatusEventLogger(StatusReceiverMultiService):
result=buildbot.status.results.Results[results],
extra_result_code=extra_result_code)
+ steps_to_send = []
+ for step in build.getSteps():
+ step_started, step_finished = step.getTimes()
+ steps_to_send.append({
+ 'step_name': step.getName(),
+ 'duration_s': step_finished - step_started,
+ 'result': buildbot.status.results.Results[step.getResults()[0]],
+ })
+
# If property doesn't exist, this function returns None.
# Note: this is not true for build.getProperty(), it raises KeyError.
project_id = properties.getProperty('patch_project')
@@ -499,7 +510,7 @@ class StatusEventLogger(StatusReceiverMultiService):
self.send_build_result(
scheduled, started, finished, builderName, bot,
buildbot.status.results.Results[results],
- project_id, subproject_tag)
+ project_id, subproject_tag, steps=steps_to_send)
def builderRemoved(self, builderName):
self.log('builderRemoved', '%s', builderName)
« no previous file with comments | « no previous file | scripts/master/unittests/status_logger_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698