Remove metrics from the buffer on write (#5052)
This commit is contained in:
parent
9b3452a65d
commit
0a506a93fe
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue