Class ReservoirSampler
java.lang.Object
org.infinispan.extendedstats.percentiles.ReservoirSampler
Keeps the sample for percentile calculations.
Please check this for more details
- Since:
- 6.0
- Author:
- Roberto Palmieri, Diego Didona, Pedro Ruivo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal double
getKPercentile
(int k) final void
insertSample
(double sample) final void
reset()
-
Constructor Details
-
ReservoirSampler
public ReservoirSampler() -
ReservoirSampler
public ReservoirSampler(int numSpots)
-
-
Method Details
-
insertSample
public final void insertSample(double sample) -
getKPercentile
- Parameters:
k
- the percentage of observations. Should be a value between 0 and 100 exclusively.- Returns:
- the percentile value for the k% observations.
- Throws:
IllegalArgumentException
- if k is not between 0 and 100 exclusively.
-
reset
public final void reset()
-