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

Method test_gauge_labels

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

Source from the content-addressed store, hash-verified

793 self.assertEqual(1, self.registry.get_sample_value('g', {}))
794
795 def test_gauge_labels(self):
796 cmf = GaugeMetricFamily('g', 'help', labels=['a'])
797 cmf.add_metric(['b'], 2)
798 self.custom_collector(cmf)
799 self.assertEqual(2, self.registry.get_sample_value('g', {'a': 'b'}))
800
801 def test_summary(self):
802 self.custom_collector(SummaryMetricFamily('s', 'help', count_value=1, sum_value=2))

Callers

nothing calls this directly

Calls 4

add_metricMethod · 0.95
custom_collectorMethod · 0.95
GaugeMetricFamilyClass · 0.90
get_sample_valueMethod · 0.80

Tested by

no test coverage detected