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

Unified Diff: appengine/swarming/event_mon_metrics.py

Issue 2534943002: Upload basic info about completed swarming tasks to event_mon (Closed)
Patch Set: fixes Created 4 years, 1 month 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 | appengine/swarming/gae_event_mon » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/event_mon_metrics.py
diff --git a/appengine/swarming/event_mon_metrics.py b/appengine/swarming/event_mon_metrics.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba5a3b68e062bcb721f14bfe8ad4380a48e24644
--- /dev/null
+++ b/appengine/swarming/event_mon_metrics.py
@@ -0,0 +1,30 @@
+# Copyright 2016 The LUCI Authors. All rights reserved.
+# Use of this source code is governed under the Apache License, Version 2.0
+# that can be found in the LICENSE file.
+
+import logging
+
+import gae_event_mon
+
+
+def initialize():
+ gae_event_mon.initialize('swarming')
+
+
+def send_task_event(task_result_summary):
+ """Sends an event_mon event about a swarming task.
+
+ Currently implemented as sending a HTTP request.
+
+ Args:
+ task_result_summary: TaskResultSummary object.
+ """
+ event = gae_event_mon.Event('POINT')
+ event.proto.swarming_task_event.id = task_result_summary.task_id
+
+ # Isolate rest of the app from monitoring pipeline issues. They should
+ # not cause outage of swarming.
+ try:
+ event.send()
+ except Exception:
+ logging.exception('Caught exception while sending event')
« no previous file with comments | « no previous file | appengine/swarming/gae_event_mon » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698