Skip to content

Commit

Permalink
Time the duration of each sink's flushes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cory-stripe committed Jul 18, 2017
1 parent 9ab9b22 commit 6975298
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,13 @@ func (s *Server) flushTraces(ctx context.Context) {
})

for _, sink := range s.tracerSinks {
sinkFlushStart := time.Now()
sink.flush(span.Attach(ctx), s, sink.tracerThunk, ssfSpans)
tags := []string{
fmt.Sprintf("sink:%s", sink.name),
fmt.Sprintf("service:%s", trace.Service),
}
s.Statsd.TimeInMilliseconds("worker.trace.sink.flush_duration_ns", float64(time.Since(sinkFlushStart).Nanoseconds()), []string{fmt.Sprintf("sink:%s", sink.name)}, 1.0)

s.Statsd.Count("worker.trace.sink.flushed_total", int64(len(ssfSpans)), tags, 1)
}
Expand Down

0 comments on commit 6975298

Please sign in to comment.