Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Delay and Jitter #41

Open
mrfelpa opened this issue Aug 31, 2023 · 0 comments
Open

Delay and Jitter #41

mrfelpa opened this issue Aug 31, 2023 · 0 comments

Comments

@mrfelpa
Copy link

mrfelpa commented Aug 31, 2023

seem to be calculated using random values. Setting a given minimum and maximum delay can be useful, for example:

`
function Get-CalculatedDelay
{
param(
[int] $MinDelay,
[int] $MaxDelay,
[int] $JitterPercentage
)

$jitterFactor = (Get-Random -Minimum (-$JitterPercentage) -Maximum $JitterPercentage) / 100.0
$baseDelay = Get-Random -Minimum $MinDelay -Maximum $MaxDelay
$delay = [math]::Round($baseDelay * (1 + $jitterFactor))

return $delay

}

`

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant