From b183b1e7521cf384cf0884d196b86467ea0d3c84 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Wed, 4 Sep 2019 19:05:20 -0700 Subject: [PATCH] Fix slice allocation (#197) --- metrics_batcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics_batcher.go b/metrics_batcher.go index 54a92e9..3b8bb3c 100644 --- a/metrics_batcher.go +++ b/metrics_batcher.go @@ -52,7 +52,7 @@ func (mb *metricsBatcher) addTimeSeries(ts *monitoringpb.TimeSeries) { Name: monitoring.MetricProjectPath(mb.projectID), TimeSeries: mb.allTss, }) - mb.allTss = make([]*monitoringpb.TimeSeries, maxTimeSeriesPerUpload) + mb.allTss = make([]*monitoringpb.TimeSeries, 0, maxTimeSeriesPerUpload) } }