Prometheus: Reduce memory allocations in QueryData.processExemplars (#63373)

* tsdb/prometheus/querydata: Reduce memory allocations in QueryData.processExemplars

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2023-03-22 10:59:39 +01:00
committed by GitHub
parent 6d5242e54c
commit f7ee42d871
6 changed files with 41 additions and 27 deletions
@@ -48,8 +48,11 @@ func BenchmarkExemplarJson(b *testing.B) {
Body: io.NopCloser(bytes.NewReader(responseBytes)),
}
tCtx.httpProvider.setResponse(&res)
_, err := tCtx.queryData.Execute(context.Background(), query)
resp, err := tCtx.queryData.Execute(context.Background(), query)
require.NoError(b, err)
for _, r := range resp.Responses {
require.NoError(b, r.Error)
}
}
}