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

Method test_summary_quantiles

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

Source from the content-addressed store, hash-verified

107 self.assertEqual([summary], list(families))
108
109 def test_summary_quantiles(self):
110 families = text_string_to_metric_families("""# TYPE a summary
111# HELP a help
112a_count 1
113a_sum 2
114a{quantile="0.5"} 0.7
115a{quantile="1"} 0.8
116# EOF
117""")
118 # The Python client doesn't support quantiles, but we
119 # still need to be able to parse them.
120 metric_family = SummaryMetricFamily("a", "help", count_value=1, sum_value=2)
121 metric_family.add_sample("a", {"quantile": "0.5"}, 0.7)
122 metric_family.add_sample("a", {"quantile": "1"}, 0.8)
123 self.assertEqual([metric_family], list(families))
124
125 def test_simple_histogram(self):
126 families = text_string_to_metric_families("""# TYPE a histogram

Callers

nothing calls this directly

Calls 3

SummaryMetricFamilyClass · 0.90
add_sampleMethod · 0.80

Tested by

no test coverage detected