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

Unified Diff: appengine/gce-backend/metrics.py

Issue 2520873003: Count instances managed by each instance template (Closed)
Patch Set: Replace old metric with new 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 | « appengine/gce-backend/instances.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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():
« no previous file with comments | « appengine/gce-backend/instances.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698