Package com.codahale.metrics
Class LockFreeExponentiallyDecayingReservoir.Builder
- java.lang.Object
-
- com.codahale.metrics.LockFreeExponentiallyDecayingReservoir.Builder
-
- Enclosing class:
- LockFreeExponentiallyDecayingReservoir
public static final class LockFreeExponentiallyDecayingReservoir.Builder extends Object
By default this uses a size of 1028 elements, which offers a 99.9% confidence level with a 5% margin of error assuming a normal distribution, and an alpha factor of 0.015, which heavily biases the reservoir to the past 5 minutes of measurements.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LockFreeExponentiallyDecayingReservoir.Builder
alpha(double value)
Alpha is the exponential decay factor.Reservoir
build()
LockFreeExponentiallyDecayingReservoir.Builder
clock(Clock value)
Clock instance used for decay.LockFreeExponentiallyDecayingReservoir.Builder
rescaleThreshold(Duration value)
Interval at which this reservoir is rescaled.LockFreeExponentiallyDecayingReservoir.Builder
size(int value)
Maximum number of samples to keep in the reservoir.
-
-
-
Method Detail
-
size
public LockFreeExponentiallyDecayingReservoir.Builder size(int value)
Maximum number of samples to keep in the reservoir. Once this number is reached older samples are replaced (based on weight, with some amount of random jitter).
-
alpha
public LockFreeExponentiallyDecayingReservoir.Builder alpha(double value)
Alpha is the exponential decay factor. Higher values bias results more heavily toward newer values.
-
rescaleThreshold
public LockFreeExponentiallyDecayingReservoir.Builder rescaleThreshold(Duration value)
Interval at which this reservoir is rescaled.
-
clock
public LockFreeExponentiallyDecayingReservoir.Builder clock(Clock value)
Clock instance used for decay.
-
build
public Reservoir build()
-
-