From dfdca74fd1154b18e0be748009ad3d1ea21cb489 Mon Sep 17 00:00:00 2001 From: Pierre-Etienne Delon Date: Tue, 30 Apr 2024 17:54:39 +0200 Subject: [PATCH] fix: use `TimestampFunc` in busrt sampler (#671) --- sampler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sampler.go b/sampler.go index 1be98c4f..83ce2ed3 100644 --- a/sampler.go +++ b/sampler.go @@ -84,7 +84,7 @@ func (s *BurstSampler) Sample(lvl Level) bool { } func (s *BurstSampler) inc() uint32 { - now := time.Now().UnixNano() + now := TimestampFunc().UnixNano() resetAt := atomic.LoadInt64(&s.resetAt) var c uint32 if now > resetAt {