Class LogNormal
- java.lang.Object
-
- com.github.tomakehurst.wiremock.http.LogNormal
-
- All Implemented Interfaces:
DelayDistribution
public final class LogNormal extends java.lang.Object implements DelayDistribution
Returns log normally distributed values. Takes two parameters, the median (50th percentile) of the lognormal and the standard deviation of the underlying normal distribution, plus an optional maximum value to truncate the result by resampling to prevent an extra long tailThe larger the standard deviation the longer the tails.
- See Also:
- lognormal example
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longsampleMillis()Samples a delay in milliseconds from the distribution.
-
-
-
Constructor Detail
-
LogNormal
public LogNormal(double median, double sigma, java.lang.Double maxValue)- Parameters:
median- 50th percentile of the distribution in millissigma- standard deviation of the underlying normal distribution, a larger value produces a longer tailmaxValue- the maximum value to truncate the distribution at, or null to disable truncation
-
LogNormal
public LogNormal(double median, double sigma)- Parameters:
median- 50th percentile of the distribution in millissigma- standard deviation of the distribution, a larger value produces a longer tail
-
-
Method Detail
-
sampleMillis
public long sampleMillis()
Description copied from interface:DelayDistributionSamples a delay in milliseconds from the distribution.- Specified by:
sampleMillisin interfaceDelayDistribution- Returns:
- next delay in millis
-
-