| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. |
| 4 |
| 5 import logging |
| 6 |
| 7 import gae_event_mon |
| 8 |
| 9 |
| 10 def initialize(): |
| 11 gae_event_mon.initialize('swarming') |
| 12 |
| 13 |
| 14 def send_task_event(task_result_summary): |
| 15 """Sends an event_mon event about a swarming task. |
| 16 |
| 17 Currently implemented as sending a HTTP request. |
| 18 |
| 19 Args: |
| 20 task_result_summary: TaskResultSummary object. |
| 21 """ |
| 22 event = gae_event_mon.Event('POINT') |
| 23 event.proto.swarming_task_event.id = task_result_summary.task_id |
| 24 |
| 25 # Isolate rest of the app from monitoring pipeline issues. They should |
| 26 # not cause outage of swarming. |
| 27 try: |
| 28 event.send() |
| 29 except Exception: |
| 30 logging.exception('Caught exception while sending event') |
| OLD | NEW |