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 otherpirate committed Mar 15, 2019
1 parent a209827 commit 4070667
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 4070667

Please sign in to comment.