summary refs log tree commit diff
path: root/synapse/metrics
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-05-22 16:28:23 -0500
committerAmber Brown <hawkowl@atleastfornow.net>2018-05-22 16:28:23 -0500
commit85ba83eb5100abf02cf373d9a8d5010526facd45 (patch)
treee896a3ee04b5dbe59c07ba72293278795e0490b8 /synapse/metrics
parentfix the test failures (diff)
downloadsynapse-85ba83eb5100abf02cf373d9a8d5010526facd45.tar.xz
fixes
Diffstat (limited to 'synapse/metrics')
-rw-r--r--synapse/metrics/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index ab0b921497..38408efb54 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -29,12 +29,20 @@ from twisted.internet import reactor
 
 logger = logging.getLogger(__name__)
 
-
 running_on_pypy = platform.python_implementation() == 'PyPy'
 all_metrics = []
 all_collectors = []
 all_gauges = {}
 
+
+class RegistryProxy(object):
+
+    def collect(self):
+        for metric in REGISTRY.collect():
+            if not metric.name.startswith("__"):
+                yield metric
+
+
 @attr.s(hash=True)
 class LaterGauge(object):
 
@@ -45,7 +53,7 @@ class LaterGauge(object):
 
     def collect(self):
 
-        g = GaugeMetricFamily(self.name, self.desc, self.labels)
+        g = GaugeMetricFamily(self.name, self.desc, labels=self.labels)
 
         try:
             calls = self.caller()