Skip to content

Commit

Permalink
remote tracer: wait a second to accumulate batches
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Nov 15, 2019
1 parent 57ea27e commit 2fc5518
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 2fc5518

Please sign in to comment.