remote tracer: wait a second to accumulate batches

This commit is contained in:
vyzo 2019-11-14 13:05:18 +02:00
parent 57ea27eef7
commit 2fc5518a00
1 changed files with 4 additions and 1 deletions

View File

@ -178,11 +178,14 @@ func (t *RemoteTracer) doWrite() {
for {
_, ok := <-t.ch
// nil out the buffer to gc events
// nil out the buffer to gc events when swapping buffers
for i := range buf {
buf[i] = nil
}
// wait a bit to accumulate a batch
time.Sleep(time.Second)
t.mx.Lock()
tmp := t.buf
t.buf = buf[:0]