diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-22 16:28:23 -0500 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-22 16:28:23 -0500 |
commit | 85ba83eb5100abf02cf373d9a8d5010526facd45 (patch) | |
tree | e896a3ee04b5dbe59c07ba72293278795e0490b8 /synapse/metrics/__init__.py | |
parent | fix the test failures (diff) | |
download | synapse-85ba83eb5100abf02cf373d9a8d5010526facd45.tar.xz |
fixes
Diffstat (limited to 'synapse/metrics/__init__.py')
-rw-r--r-- | synapse/metrics/__init__.py | 12 |
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() |