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

Class MyCollector

tests/test_exposition.py:188–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 return 123.0
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 2

test_nonnumberMethod · 0.70
test_timestampMethod · 0.70

Calls

no outgoing calls

Tested by 2

test_nonnumberMethod · 0.56
test_timestampMethod · 0.56