Chromium Code Reviews| Index: appengine/gce-backend/metrics.py |
| diff --git a/appengine/gce-backend/metrics.py b/appengine/gce-backend/metrics.py |
| index 0b4bf227be14f37c99f68d5bc6e0ccd7259fbd05..4be7545ab366d9de2d123fc6c4e234583d58fe31 100644 |
| --- a/appengine/gce-backend/metrics.py |
| +++ b/appengine/gce-backend/metrics.py |
| @@ -9,6 +9,7 @@ import logging |
| import gae_event_mon |
| import gae_ts_mon |
| +import instance_group_managers |
| import instances |
| @@ -28,6 +29,10 @@ GLOBAL_METRICS = { |
| 'machine_provider/gce_backend/instances', |
| description='Current count of the number of instances.', |
| ), |
| + 'instances/v2': gae_ts_mon.GaugeMetric( |
| + 'machine_provider/gce_backend/instances/v2', |
|
Sergey Berezin (google)
2016/11/23 02:28:25
I'd name it in a more self-descriptive way, e.g. .
smut
2016/11/23 22:50:57
I tried modifying the existing metric and the metr
Sergey Berezin (google)
2016/11/23 23:42:44
No, the field schema should be consistent globally
smut
2016/11/23 23:51:09
No, I don't care about the history. I would prefer
Sergey Berezin (google)
2016/11/24 03:51:47
Great, I deleted the metric - once the update prop
|
| + description='Current count of the number of instances.', |
| + ), |
| } |
| @@ -53,6 +58,15 @@ def compute_global_metrics(): |
| }, |
| target_fields=GLOBAL_TARGET_FIELDS, |
| ) |
| + for name, count in instance_group_managers.count_instances().iteritems(): |
| + logging.info('%s: %s', name, count) |
| + GLOBAL_METRICS['instances/v2'].set( |
| + count, |
| + fields={ |
| + 'instance_template': name, |
| + }, |
| + target_fields=GLOBAL_TARGET_FIELDS, |
| + ) |
| def initialize(): |