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

Method test_info_timestamps

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

Source from the content-addressed store, hash-verified

406 self.assertEqual([InfoMetricFamily("a", "help", {'foo': 'bar'})], list(families))
407
408 def test_info_timestamps(self):
409 families = text_string_to_metric_families("""# TYPE a info
410# HELP a help
411a_info{a="1",foo="bar"} 1 1
412a_info{a="2",foo="bar"} 1 0
413# EOF
414""")
415 imf = InfoMetricFamily("a", "help")
416 imf.add_sample("a_info", {"a": "1", "foo": "bar"}, 1, Timestamp(1, 0))
417 imf.add_sample("a_info", {"a": "2", "foo": "bar"}, 1, Timestamp(0, 0))
418 self.assertEqual([imf], list(families))
419
420 def test_simple_stateset(self):
421 families = text_string_to_metric_families("""# TYPE a stateset

Callers

nothing calls this directly

Calls 4

InfoMetricFamilyClass · 0.90
TimestampClass · 0.85
add_sampleMethod · 0.80

Tested by

no test coverage detected