Class ReservoirSampler

java.lang.Object
org.infinispan.extendedstats.percentiles.ReservoirSampler

public class ReservoirSampler extends Object
Keeps the sample for percentile calculations.

Please check this for more details

Since:
6.0
Author:
Roberto Palmieri, Diego Didona, Pedro Ruivo
  • Constructor Details

    • ReservoirSampler

      public ReservoirSampler()
    • ReservoirSampler

      public ReservoirSampler(int numSpots)
  • Method Details

    • insertSample

      public final void insertSample(double sample)
    • getKPercentile

      public final double getKPercentile(int k) throws IllegalArgumentException
      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()