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

Method test_qs_parsing

tests/test_aiohttp.py:172–192  ·  view source on GitHub ↗

Only metrics that match the 'name[]' query string param appear

(self)

Source from the content-addressed store, hash-verified

170 )
171
172 async def test_qs_parsing(self):
173 """Only metrics that match the 'name[]' query string param appear"""
174
175 metrics = [("asdf", "first test metric", 1), ("bsdf", "second test metric", 2)]
176
177 for m in metrics:
178 self.increment_metrics(*m)
179
180 for i_1 in range(len(metrics)):
181 async with self.client.get(
182 "/metrics",
183 params={"name[]": f"{metrics[i_1][0]}_total"},
184 ) as response:
185 output = await response.text()
186 self.assert_metrics(output, *metrics[i_1])
187
188 for i_2 in range(len(metrics)):
189 if i_1 == i_2:
190 continue
191
192 self.assert_not_metrics(output, *metrics[i_2])

Callers

nothing calls this directly

Calls 5

increment_metricsMethod · 0.95
assert_metricsMethod · 0.95
assert_not_metricsMethod · 0.95
getMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected