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

This commit is contained in:
Oleg Kovalov 2019-06-10 08:12:46 +02:00 committed by Carl Bergquist
parent 4ddb860727
commit 6a76a92aff

View File

@ -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 {