Index: infra_libs/ts_mon/interface.py |
diff --git a/infra_libs/ts_mon/interface.py b/infra_libs/ts_mon/interface.py |
index e24bf14d120309f21c77e967f35908a3c5d31741..2e3d498375bd32dd2a273ed2b602a346215df379 100644 |
--- a/infra_libs/ts_mon/interface.py |
+++ b/infra_libs/ts_mon/interface.py |
@@ -39,7 +39,7 @@ import time |
from monacq.proto import metrics_pb2 |
-from infra_libs.ts_mon import errors |
+from infra_libs.ts_mon.common import errors |
# The maximum number of MetricsData messages to include in each HTTP request. |
# MetricsCollections larger than this will be split into multiple requests. |
@@ -116,8 +116,9 @@ def register(metric): |
""" |
# If someone is registering the same metric object twice, that's okay, but |
# registering two different metric objects with the same metric name is not. |
- if metric in state.metrics: |
- return |
+ for m in state.metrics: |
+ if metric == m: |
+ return |
agable
2015/08/19 01:14:42
I don't think this does what we want: This means t
|
if any([metric._name == m._name for m in state.metrics]): |
raise errors.MonitoringDuplicateRegistrationError(metric._name) |