diff --git a/sampler.go b/sampler.go index 2360f0d..7b0923e 100644 --- a/sampler.go +++ b/sampler.go @@ -46,8 +46,12 @@ type BasicSampler struct { // Sample implements the Sampler interface. func (s *BasicSampler) Sample(lvl Level) bool { + n := s.N + if n == 1 { + return true + } c := atomic.AddUint32(&s.counter, 1) - return c%s.N == s.N-1 + return c%n == 1 } // BurstSampler lets Burst events pass per Period then pass the decision to