Skip to content

Commit

Permalink
chore: querier start jitter corresponds to 0-1 * interval
Browse files Browse the repository at this point in the history
  • Loading branch information
clementnuss committed Jan 17, 2023
1 parent 2cfb91f commit 9b214ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ func newQuerier(ctx context.Context, config HTTPServerConfig, lgr *slog.Logger,
return &q, nil
}

// Run starts the querier at the specified interval, with a random jitter of 0-500ms
// Run starts the querier at the specified interval, with a random jitter of 0-interval
func (q *Querier) Run(interval *time.Duration) {
//nolint:gosec // No need for a cryptographic secure random number since this is only used for a jitter.
jitter := time.Duration(rand.Float64() * float64(500*time.Millisecond))
jitter := time.Duration(rand.Float64() * float64(*interval))

q.lgr.Info("start a new quierer with some delay",
"jitter", jitter,
Expand Down

0 comments on commit 9b214ac

Please sign in to comment.