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

Method validate_metrics

tests/test_aiohttp.py:88–100  ·  view source on GitHub ↗

AIOHTTP handler serves the metrics from the provided registry.

(
        self,
        metric_name: str,
        help_text: str,
        increments: int,
    )

Source from the content-addressed store, hash-verified

86 self.assert_metrics(output, metric_name, help_text, increments)
87
88 async def validate_metrics(
89 self,
90 metric_name: str,
91 help_text: str,
92 increments: int,
93 ) -> None:
94 """
95 AIOHTTP handler serves the metrics from the provided registry.
96 """
97 self.increment_metrics(metric_name, help_text, increments)
98 async with self.client.get("/metrics") as response:
99 response.raise_for_status()
100 await self.assert_outputs(response, metric_name, help_text, increments)
101
102 async def test_report_metrics_1(self):
103 await self.validate_metrics("counter", "A counter", 2)

Callers 4

test_report_metrics_1Method · 0.95
test_report_metrics_2Method · 0.95
test_report_metrics_3Method · 0.95
test_report_metrics_4Method · 0.95

Calls 3

increment_metricsMethod · 0.95
assert_outputsMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected