Use Gaussian request delays with 500 ms minimum and one-second mean
This commit is contained in:
1 parent
453e37b3c3
commit
d69fcf8c76
9 files changed
+573
-164
No files matched your search
@@ -37,9 +37,17 @@ prev.setSuccessful(true)
|
||||
{check}
|
||||
''')
|
||||
script(t,'JSR223Timer','Gaussian interaction pause', """def rng = vars.getObject('user_random')
|
||||
double mean = Double.parseDouble(props.getProperty('think_mean_ms','4000'))
|
||||
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','2000'))
|
||||
return Math.max(0L,Math.round(mean + rng.nextGaussian() * deviation))
|
||||
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||
// Symmetric truncation keeps the expected mean at the configured value.
|
||||
double maximum = 2 * mean - minimum
|
||||
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||
double delay
|
||||
while (true) {
|
||||
delay = mean + rng.nextGaussian() * deviation
|
||||
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||
}
|
||||
""")
|
||||
|
||||
PERIOD = 'from=${period_from}&to=${period_to}'
|
||||
|
||||
Reference in new issue
Block a user