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

Method test_counter_adds

tests/test_multiprocess.py:67–74  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 values.ValueClass = MutexValue
66
67 def test_counter_adds(self):
68 c1 = Counter('c', 'help', registry=None)
69 values.ValueClass = MultiProcessValue(lambda: 456)
70 c2 = Counter('c', 'help', registry=None)
71 self.assertEqual(0, self.registry.get_sample_value('c_total'))
72 c1.inc(1)
73 c2.inc(2)
74 self.assertEqual(3, self.registry.get_sample_value('c_total'))
75
76 def test_summary_adds(self):
77 s1 = Summary('s', 'help', registry=None)

Callers

nothing calls this directly

Calls 4

incMethod · 0.95
CounterClass · 0.90
MultiProcessValueFunction · 0.90
get_sample_valueMethod · 0.80

Tested by

no test coverage detected