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

Method validate_metrics

tests/test_asgi.py:119–130  ·  view source on GitHub ↗

ASGI app serves the metrics from the provided registry.

(self, metric_name, help_text, increments)

Source from the content-addressed store, hash-verified

117 self.assert_metrics(output, metric_name, help_text, increments)
118
119 def validate_metrics(self, metric_name, help_text, increments):
120 """
121 ASGI app serves the metrics from the provided registry.
122 """
123 self.increment_metrics(metric_name, help_text, increments)
124 # Create and run ASGI app
125 app = make_asgi_app(self.registry)
126 self.seed_app(app)
127 self.send_default_request()
128 # Assert outputs
129 outputs = self.get_all_output()
130 self.assert_outputs(outputs, metric_name, help_text, increments, compressed=False)
131
132 def test_report_metrics_1(self):
133 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 6

increment_metricsMethod · 0.95
seed_appMethod · 0.95
send_default_requestMethod · 0.95
get_all_outputMethod · 0.95
assert_outputsMethod · 0.95
make_asgi_appFunction · 0.90

Tested by

no test coverage detected