MCPcopy Index your code
hub / github.com/prometheus/client_python / custom_collector

Method custom_collector

tests/test_exposition.py:35–40  ·  view source on GitHub ↗
(self, metric_family)

Source from the content-addressed store, hash-verified

33 time.time = self.old_time
34
35 def custom_collector(self, metric_family):
36 class CustomCollector:
37 def collect(self):
38 return [metric_family]
39
40 self.registry.register(CustomCollector())
41
42 def test_counter(self):
43 c = Counter('cc', 'A counter', registry=self.registry)

Callers 1

test_gaugehistogramMethod · 0.95

Calls 2

CustomCollectorClass · 0.70
registerMethod · 0.45

Tested by

no test coverage detected