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

Method test_summary_labels

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

Source from the content-addressed store, hash-verified

804 self.assertEqual(2, self.registry.get_sample_value('s_sum', {}))
805
806 def test_summary_labels(self):
807 cmf = SummaryMetricFamily('s', 'help', labels=['a'])
808 cmf.add_metric(['b'], count_value=1, sum_value=2)
809 self.custom_collector(cmf)
810 self.assertEqual(1, self.registry.get_sample_value('s_count', {'a': 'b'}))
811 self.assertEqual(2, self.registry.get_sample_value('s_sum', {'a': 'b'}))
812
813 def test_histogram(self):
814 self.custom_collector(HistogramMetricFamily('h', 'help', buckets=[('0', 1), ('+Inf', 2)], sum_value=3))

Callers

nothing calls this directly

Calls 4

add_metricMethod · 0.95
custom_collectorMethod · 0.95
SummaryMetricFamilyClass · 0.90
get_sample_valueMethod · 0.80

Tested by

no test coverage detected