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

Method test_histogram

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

Source from the content-addressed store, hash-verified

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))
815 self.assertEqual(1, self.registry.get_sample_value('h_bucket', {'le': '0'}))
816 self.assertEqual(2, self.registry.get_sample_value('h_bucket', {'le': '+Inf'}))
817 self.assertEqual(2, self.registry.get_sample_value('h_count', {}))
818 self.assertEqual(3, self.registry.get_sample_value('h_sum', {}))
819
820 def test_histogram_labels(self):
821 cmf = HistogramMetricFamily('h', 'help', labels=['a'])

Callers

nothing calls this directly

Calls 3

custom_collectorMethod · 0.95
get_sample_valueMethod · 0.80

Tested by

no test coverage detected