Chromium Code Reviews| Index: scripts/master/status_logger.py |
| diff --git a/scripts/master/status_logger.py b/scripts/master/status_logger.py |
| index 91a54d13e575e6055eb5fb4fc681be842e4545db..d0bd7034f1fa2f94c6380ad421fbaa3b0eb913a1 100644 |
| --- a/scripts/master/status_logger.py |
| +++ b/scripts/master/status_logger.py |
| @@ -183,7 +183,6 @@ class StatusEventLogger(StatusReceiverMultiService): |
| self._last_checked_active = now |
| return self._active |
| - |
| def send_build_result( |
| self, scheduled, started, finished, builder_name, bot_name, result, |
| project_id=None, subproject_tag=None, steps=None, pre_test_time_s=None): |
| @@ -210,6 +209,34 @@ class StatusEventLogger(StatusReceiverMultiService): |
| d['pre_test_time_s'] = pre_test_time_s |
| self.ts_mon_logger.info(json.dumps(d)) |
| + def send_step_results( |
| + self, timestamp, builder_name, bot_name, |
| + step_result, project_id, subproject_tag): |
| + """Log step results for ts_mon |
| + |
| + Args: |
| + timestamp(int): when the event was generated (end of a step). Seconds |
| + since the Unix epoch. |
| + builder_name(str): name of the builder the steps are part of. |
| + bot_name(str): name of the machine running the build. |
| + step_result (str): result for this step. |
| + project_id(str): 'project' as shown on the codereview. |
| + subproject_tag(str): a mention of a subproject. Mostly used to distinguish |
| + between chromium and blink CLs in the chromium project. |
| + """ |
| + # the presence of the field 'step_result' is how the collecting daemon |
|
Sergey Berezin
2016/04/11 23:49:48
nit: Capitalize the first word.
|
| + # tells the difference between this case and the one from send_build_result. |
| + d = { |
| + 'timestamp': timestamp, |
| + 'builder': builder_name, |
| + 'step_result': step_result, |
| + 'slave': bot_name, |
| + 'project_id': project_id, |
| + 'subproject_tag': subproject_tag, |
| + } |
| + self.ts_mon_logger.info(json.dumps(d)) |
| + |
| + |
| def send_build_event(self, timestamp_kind, timestamp, build_event_type, |
| bot_name, builder_name, build_number, build_scheduled_ts, |
| step_name=None, step_number=None, result=None, |
| @@ -490,6 +517,19 @@ class StatusEventLogger(StatusReceiverMultiService): |
| result=buildbot.status.results.Results[results[0]], |
| patch_url=self._get_patch_url(build.getProperties())) |
| + # Send step result to ts-mon |
| + properties = build.getProperties() |
| + project_id = properties.getProperty('patch_project') |
| + subproject_tag = properties.getProperty('subproject_tag') |
| + |
| + self.send_step_results( |
| + finished, |
| + builder_name, |
| + bot, |
| + buildbot.status.results.Results[step.getResults()[0]], |
| + project_id, |
| + subproject_tag) |
| + |
| def buildFinished(self, builderName, build, results): |
| build_number = build.getNumber() |
| bot = build.getSlavename() |