Allow configuring a range for jitter to be within #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, jitter would only be available within a single second of the desired interval - eg, if we had jitter enabled and our next interval was 4.5 seconds, the actual calculated interval would be uniformly distributed between 4.5s and 5.5s.
The issue with this approach is that it doesn't let callers spread load out efficiently over long timescales - eg, if i have a fleet of millions of agents set to ping every ten seconds, spreading those pings out over one second is only a little better than having them hit all at once - we'd ideally like to be able to spread those pings out over a larger area of the ping interval.
This commit PR us to do just that - we can configure a custom range for jitter. To use our previous example, if we set a jitter range of (-1s, 3s], the actual intervals would be uniformly distributed between 3.5s -and 7.5s.