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

Method test_restricted_registry

tests/test_core.py:965–972  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

963 self.assertRaises(ValueError, self.custom_collector, CounterMetricFamily('c_total', 'help', value=1), registry)
964
965 def test_restricted_registry(self):
966 registry = CollectorRegistry()
967 Counter('c_total', 'help', registry=registry)
968 Summary('s', 'help', registry=registry).observe(7)
969
970 m = Metric('s', 'help', 'summary')
971 m.samples = [Sample('s_sum', {}, 7)]
972 self.assertEqual([m], list(registry.restricted_registry(['s_sum']).collect()))
973
974 def test_restricted_registry_adds_new_metrics(self):
975 registry = CollectorRegistry()

Callers

nothing calls this directly

Calls 8

restricted_registryMethod · 0.95
CounterClass · 0.90
MetricClass · 0.90
CollectorRegistryClass · 0.85
SummaryClass · 0.85
SampleClass · 0.85
observeMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected