| Index: appengine/swarming/event_mon_metrics.py
|
| diff --git a/appengine/swarming/event_mon_metrics.py b/appengine/swarming/event_mon_metrics.py
|
| index 00eb1169eb13a2f0f2b4a74092718570af2ebef8..b49d7c9b9afa5cfbd9ea84d8ee45e3e5189033ff 100644
|
| --- a/appengine/swarming/event_mon_metrics.py
|
| +++ b/appengine/swarming/event_mon_metrics.py
|
| @@ -10,19 +10,19 @@ import gae_event_mon
|
| from server import task_result
|
|
|
|
|
| -DIMENSIONS = (
|
| - ('cores', int),
|
| - ('cpu', unicode),
|
| - ('device_os', unicode),
|
| - ('device_type', unicode),
|
| - ('gpu', unicode),
|
| - ('hidpi', unicode),
|
| - ('machine_type', unicode),
|
| - ('os', unicode),
|
| - ('pool', unicode),
|
| - ('xcode_version', unicode),
|
| - ('zone', unicode),
|
| -)
|
| +DIMENSIONS = {
|
| + 'cores': int,
|
| + 'cpu': unicode,
|
| + 'device_os': unicode,
|
| + 'device_type': unicode,
|
| + 'gpu': unicode,
|
| + 'hidpi': unicode,
|
| + 'machine_type': unicode,
|
| + 'os': unicode,
|
| + 'pool': unicode,
|
| + 'xcode_version': unicode,
|
| + 'zone': unicode,
|
| +}
|
|
|
|
|
| TAGS = {
|
| @@ -90,10 +90,9 @@ def _task_summary_to_proto(summary, event):
|
| package_proto = cipd_proto.packages.add()
|
| _cipd_package_to_proto(package, package_proto)
|
|
|
| - for d, t in DIMENSIONS:
|
| - if d in task_properties.dimensions:
|
| - getattr(properties_proto.dimensions, d).append(
|
| - t(task_properties.dimensions[d]))
|
| + for key, value in task_properties.dimensions:
|
| + if key in DIMENSIONS:
|
| + getattr(properties_proto.dimensions, key).append(DIMENSIONS[key](value))
|
|
|
| if task_properties.execution_timeout_secs:
|
| properties_proto.execution_timeout_s = \
|
| @@ -121,7 +120,7 @@ def _task_summary_to_proto(summary, event):
|
| event.proto.swarming_task_event.bot_id = summary.bot_id
|
| event.proto.swarming_task_event.bot_version = summary.bot_version
|
|
|
| - for d, t in DIMENSIONS:
|
| + for d, t in DIMENSIONS.iteritems():
|
| for v in summary.bot_dimensions.get(d, []):
|
| getattr(event.proto.swarming_task_event.bot_dimensions, d).append(t(v))
|
|
|
|
|