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

Method test_counter

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

Source from the content-addressed store, hash-verified

40 self.registry.register(CustomCollector())
41
42 def test_counter(self):
43 c = Counter('cc', 'A counter', registry=self.registry)
44 c.inc()
45 self.assertEqual(b"""# HELP cc_total A counter
46# TYPE cc_total counter
47cc_total 1.0
48# HELP cc_created A counter
49# TYPE cc_created gauge
50cc_created 123.456
51""", generate_latest(self.registry, openmetrics.ALLOWUTF8))
52
53 def test_counter_utf8(self):
54 c = Counter('utf8.cc', 'A counter', registry=self.registry)

Callers

nothing calls this directly

Calls 3

incMethod · 0.95
CounterClass · 0.90
generate_latestFunction · 0.90

Tested by

no test coverage detected