MCPcopy Create free account
hub / github.com/prometheus/client_python / custom_collector

Method custom_collector

tests/test_core.py:737–742  ·  view source on GitHub ↗
(self, metric_family)

Source from the content-addressed store, hash-verified

735 self.registry = CollectorRegistry()
736
737 def custom_collector(self, metric_family):
738 class CustomCollector:
739 def collect(self):
740 return [metric_family]
741
742 self.registry.register(CustomCollector())
743
744 def test_untyped(self):
745 self.custom_collector(UntypedMetricFamily('u', 'help', value=1))

Callers 15

test_untypedMethod · 0.95
test_untyped_labelsMethod · 0.95
test_untyped_unitMethod · 0.95
test_counterMethod · 0.95
test_counter_utf8Method · 0.95
test_counter_totalMethod · 0.95
test_counter_labelsMethod · 0.95
test_gaugeMethod · 0.95
test_gauge_labelsMethod · 0.95
test_summaryMethod · 0.95

Calls 2

CustomCollectorClass · 0.70
registerMethod · 0.45

Tested by

no test coverage detected