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.
The issue or feature being addressed
Add a demonstrator app for the new decorrelated jitter v2 formula
This code is adapted from https://gist.github.com/reisenberger/2b696bec50d4bf059831c451f0a0cea9, originally at https://gist.github.com/george-polevoy/c0c36c3c22c9c1fe67821b1d8255413a . The original author/credit for that code is george-polevoy . Code used with permission as described at App-vNext/Polly#530 (comment)
This code verifies and demonstrates that the coefficients chosen in the Polly.Contrib.WaitAndRetry Backoff.DecorrelatedJitterBackoffV2(...) implementation generate a series of retry times whose 50th percentiles (medians) fall broadly in exponential backoff by powers of 2.
Any single individual sequence obtained from the iterator will (intentionally) show variation from this - that is the jitter. This code demonstrates (by taking a large enough sample to average out the jitter again) that the broad behaviour is exponential backoff.
The code also outputs (as csv) the distribution of retry times (over the sample set), at each try; and combined over all tries. Visualizing these (for example in PowerBI or Excel) shows the smooth distribution of the formula, as discussed in Polly issue 530 or in the readme of this repo.
Confirm the following
DecorrelatedJitterV2Explorer
branch