MCPcopy Create free account
hub / github.com/prometheus/client_python / test_unit_gauge

Method test_unit_gauge

tests/openmetrics/test_parser.py:90–97  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

88 self.assertTrue(math.isnan(list(families)[0].samples[0].value))
89
90 def test_unit_gauge(self):
91 families = text_string_to_metric_families("""# TYPE a_seconds gauge
92# UNIT a_seconds seconds
93# HELP a_seconds help
94a_seconds 1
95# EOF
96""")
97 self.assertEqual([GaugeMetricFamily("a_seconds", "help", value=1, unit='seconds')], list(families))
98
99 def test_simple_summary(self):
100 families = text_string_to_metric_families("""# TYPE a summary

Callers

nothing calls this directly

Calls 2

GaugeMetricFamilyClass · 0.90

Tested by

no test coverage detected