storj/pkg/telemetry/utils.go
JT Olds 5be1da982f pkg/telemetry: telemetry package using zeebo/admission (#26)
* pkg/telemetry: use zeebo/admission

* pkg/telemetry: updated to use latest zeebo/admission changes
2018-05-07 14:03:40 -04:00

18 lines
295 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package telemetry
import (
"math/rand"
"time"
)
func jitter(t time.Duration) time.Duration {
nanos := rand.NormFloat64()*float64(t/4) + float64(t)
if nanos <= 0 {
nanos = 1
}
return time.Duration(nanos)
}