Skip to content

Commit

Permalink
Remove metrics from the buffer on write (influxdata#5052)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored and Mathieu Lecarme committed Apr 17, 2020
1 parent ceba42f commit 0751889
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/models/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ func (b *Buffer) Accept(batch []telegraf.Metric) {
b.metricWritten(m)
}

if b.batchSize > 0 {
b.size -= b.batchSize
b.first += b.batchSize
b.size -= b.batchSize
for i := 0; i < b.batchSize; i++ {
b.buf[b.first] = nil
b.first++
b.first %= b.cap
}

Expand Down

0 comments on commit 0751889

Please sign in to comment.