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

Method collect

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

Source from the content-addressed store, hash-verified

187
188 class MyCollector:
189 def collect(self):
190 metric = Metric("nonnumber", "Non number", 'untyped')
191 metric.add_sample("nonnumber", {}, MyNumber())
192 yield metric
193
194 self.registry.register(MyCollector())
195 self.assertEqual(b'# HELP nonnumber Non number\n# TYPE nonnumber untyped\nnonnumber 123.0\n',

Callers

nothing calls this directly

Calls 4

add_sampleMethod · 0.95
MetricClass · 0.90
TimestampClass · 0.85
MyNumberClass · 0.70

Tested by

no test coverage detected