| Index: appengine/gce-backend/metrics.py
|
| diff --git a/appengine/gce-backend/metrics.py b/appengine/gce-backend/metrics.py
|
| index 0b4bf227be14f37c99f68d5bc6e0ccd7259fbd05..36ee0411c682dc557d68ea5ab73b7db18cf2229e 100644
|
| --- a/appengine/gce-backend/metrics.py
|
| +++ b/appengine/gce-backend/metrics.py
|
| @@ -9,7 +9,7 @@ import logging
|
| import gae_event_mon
|
| import gae_ts_mon
|
|
|
| -import instances
|
| +import instance_group_managers
|
|
|
|
|
| # Overrides to create app-global metrics.
|
| @@ -38,21 +38,15 @@ config_valid = gae_ts_mon.BooleanMetric(
|
|
|
|
|
| def compute_global_metrics():
|
| - orphaned, total = instances.count_instances()
|
| - GLOBAL_METRICS['instances'].set(
|
| - orphaned,
|
| - fields={
|
| - 'orphaned': True,
|
| - },
|
| - target_fields=GLOBAL_TARGET_FIELDS,
|
| - )
|
| - GLOBAL_METRICS['instances'].set(
|
| - total - orphaned,
|
| - fields={
|
| - 'orphaned': False,
|
| - },
|
| - target_fields=GLOBAL_TARGET_FIELDS,
|
| - )
|
| + for name, count in instance_group_managers.count_instances().iteritems():
|
| + logging.info('%s: %s', name, count)
|
| + GLOBAL_METRICS['instances'].set(
|
| + count,
|
| + fields={
|
| + 'instance_template': name,
|
| + },
|
| + target_fields=GLOBAL_TARGET_FIELDS,
|
| + )
|
|
|
|
|
| def initialize():
|
|
|