Commit 6a76a92a by Oleg Kovalov Committed by Carl Bergquist

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

parent 4ddb8607
...@@ -200,7 +200,8 @@ func parseResponse(value model.Value, query *PrometheusQuery) (*tsdb.QueryResult ...@@ -200,7 +200,8 @@ func parseResponse(value model.Value, query *PrometheusQuery) (*tsdb.QueryResult
for _, v := range data { for _, v := range data {
series := tsdb.TimeSeries{ series := tsdb.TimeSeries{
Name: formatLegend(v.Metric, query), Name: formatLegend(v.Metric, query),
Tags: map[string]string{}, Tags: make(map[string]string, len(v.Metric)),
Points: make([]tsdb.TimePoint, 0, len(v.Values)),
} }
for k, v := range v.Metric { 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