Commit 6a76a92a by Oleg Kovalov Committed by Carl Bergquist

Prometheus: Preallocate data for Prometheus backend response parsing (#17490)

parent 4ddb8607
......@@ -199,8 +199,9 @@ func parseResponse(value model.Value, query *PrometheusQuery) (*tsdb.QueryResult
for _, v := range data {
series := tsdb.TimeSeries{
Name: formatLegend(v.Metric, query),
Tags: map[string]string{},
Name: formatLegend(v.Metric, query),
Tags: make(map[string]string, len(v.Metric)),
Points: make([]tsdb.TimePoint, 0, len(v.Values)),
}
for k, v := range v.Metric {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment