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

Method test_gaugehistogram

tests/test_exposition.py:141–153  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

139""", generate_latest(self.registry))
140
141 def test_gaugehistogram(self):
142 self.custom_collector(GaugeHistogramMetricFamily('gh', 'help', buckets=[('1.0', 4), ('+Inf', 5)], gsum_value=7))
143 self.assertEqual(b"""# HELP gh help
144# TYPE gh histogram
145gh_bucket{le="1.0"} 4.0
146gh_bucket{le="+Inf"} 5.0
147# HELP gh_gcount help
148# TYPE gh_gcount gauge
149gh_gcount 5.0
150# HELP gh_gsum help
151# TYPE gh_gsum gauge
152gh_gsum 7.0
153""", generate_latest(self.registry))
154
155 def test_info(self):
156 i = Info('ii', 'A info', ['a', 'b'], registry=self.registry)

Callers

nothing calls this directly

Calls 3

custom_collectorMethod · 0.95
generate_latestFunction · 0.90

Tested by

no test coverage detected