Skip to content

Commit

Permalink
introduce a samler fast path
Browse files Browse the repository at this point in the history
  • Loading branch information
gbbr committed Dec 24, 2018
1 parent dce65e5 commit 696d625
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ddtrace/tracer/sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const knuthFactor = uint64(1111111111111111111)

// Sample returns true if the given span should be sampled.
func (r *rateSampler) Sample(spn ddtrace.Span) bool {
if r.rate == 1 {
// fast path
return true
}
s, ok := spn.(*span)
if !ok {
return false
Expand Down

0 comments on commit 696d625

Please sign in to comment.