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

Method test_counter_labels

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

Source from the content-addressed store, hash-verified

768 self.assertEqual(1, self.registry.get_sample_value('c_total', {}))
769
770 def test_counter_labels(self):
771 cmf = CounterMetricFamily('c_total', 'help', labels=['a', 'c_total'])
772 cmf.add_metric(['b', 'd'], 2)
773 self.custom_collector(cmf)
774 self.assertEqual(2, self.registry.get_sample_value('c_total', {'a': 'b', 'c_total': 'd'}))
775
776 def test_counter_exemplars_oneline(self):
777 cmf = CounterMetricFamily('c_total', 'help', value=23, exemplar={"bob": "osbourne"})

Callers

nothing calls this directly

Calls 4

add_metricMethod · 0.95
custom_collectorMethod · 0.95
CounterMetricFamilyClass · 0.90
get_sample_valueMethod · 0.80

Tested by

no test coverage detected