Skip to content

Commit 2ae7e4e

Browse files
mtojekmafredri
andauthored
Update coderd/prometheusmetrics/aggregator.go
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
1 parent b15c7b7 commit 2ae7e4e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

coderd/prometheusmetrics/aggregator.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,10 @@ func (ma *MetricsAggregator) Run(ctx context.Context) func() {
171171
}
172172

173173
if hasExpiredMetrics {
174-
var j int
175174
fresh := make([]annotatedMetric, 0, len(ma.queue))
176175
for _, m := range ma.queue {
177176
if m.expiryDate.After(now) {
178-
fresh[j] = m
179-
j++
177+
fresh = append(fresh, m)
180178
}
181179
}
182180
ma.queue = fresh

0 commit comments

Comments
 (0)