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

Unified Diff: appengine/swarming/event_mon_metrics.py

Issue 2584663002: swarming: send task tags to event_mon (Closed)
Patch Set: Created 4 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 | no next file » | 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
index a0d1437f8cee09b650f582a9b3f51b99a74c0b8d..d194b9b8efef7ce0e3ffde72260603c86b501017 100644
--- a/appengine/swarming/event_mon_metrics.py
+++ b/appengine/swarming/event_mon_metrics.py
@@ -25,6 +25,20 @@ DIMENSIONS = (
)
+TAGS = (
+ 'build_id',
M-A Ruel 2016/12/15 20:51:34 buildnumber ?
+ 'buildername',
+ 'codereview',
M-A Ruel 2016/12/15 20:51:34 For Rietveld triggered task, it's 'rietveld'
+ 'master',
+ 'name',
+ 'patch_project',
+ 'project',
+ 'purpose',
+ 'slavename',
+ 'stepname',
+)
+
+
def _to_timestamp(dt):
return int(time.mktime(dt.timetuple()))
@@ -140,6 +154,15 @@ def _task_summary_to_proto(summary, event):
event.proto.swarming_task_event.deduped_from = summary.deduped_from
event.proto.swarming_task_event.try_number = summary.try_number
+ for tag in summary.tags:
+ if ':' not in tag:
+ logging.error('Unexpected tag: %r', tag)
+ continue
+ name, value = tag.split(':', 1)
+ if name not in TAGS:
+ continue
+ getattr(event.proto.swarming_task_event.tags, name).append(value)
+
def initialize():
gae_event_mon.initialize('swarming')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698