Remove metrics from the buffer on write (#5052)

This commit is contained in:
Daniel Nelson
2018-11-29 12:58:48 -08:00
committed by GitHub
parent 9b3452a65d
commit 0a506a93fe

View File

@@ -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
for i := 0; i < b.batchSize; i++ {
b.buf[b.first] = nil
b.first++
b.first %= b.cap
}