This commit is contained in:
Amber Brown 2018-05-22 16:28:23 -05:00
parent 228f1f584e
commit 85ba83eb51
7 changed files with 52 additions and 24 deletions

View file

@ -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()