Class RandomFixedSizeExemplarReservoir<T extends ExemplarData>
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.exemplar.FixedSizeExemplarReservoir<T>
-
- io.opentelemetry.sdk.metrics.internal.exemplar.RandomFixedSizeExemplarReservoir<T>
-
- All Implemented Interfaces:
ExemplarReservoir<T>
class RandomFixedSizeExemplarReservoir<T extends ExemplarData> extends FixedSizeExemplarReservoir<T>
AFixedSizeExemplarReservoir
which uses an un-unweighted/naive algorithm for sampler where the probability of sampling decrease as the number of observations continue.When measurements are collected via
FixedSizeExemplarReservoir.collectAndReset(Attributes)
, the observation count is reset, making the probability of samplings effectively 1.0.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
RandomFixedSizeExemplarReservoir.RandomCellSelector
-
Constructor Summary
Constructors Modifier Constructor Description private
RandomFixedSizeExemplarReservoir(Clock clock, int size, java.util.function.Supplier<java.util.Random> randomSupplier, java.util.function.BiFunction<ReservoirCell,Attributes,T> mapAndResetCell)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static RandomFixedSizeExemplarReservoir<DoubleExemplarData>
createDouble(Clock clock, int size, java.util.function.Supplier<java.util.Random> randomSupplier)
(package private) static RandomFixedSizeExemplarReservoir<LongExemplarData>
createLong(Clock clock, int size, java.util.function.Supplier<java.util.Random> randomSupplier)
-
Methods inherited from class io.opentelemetry.sdk.metrics.internal.exemplar.FixedSizeExemplarReservoir
collectAndReset, offerDoubleMeasurement, offerLongMeasurement
-
-
-
-
Constructor Detail
-
RandomFixedSizeExemplarReservoir
private RandomFixedSizeExemplarReservoir(Clock clock, int size, java.util.function.Supplier<java.util.Random> randomSupplier, java.util.function.BiFunction<ReservoirCell,Attributes,T> mapAndResetCell)
-
-
Method Detail
-
createLong
static RandomFixedSizeExemplarReservoir<LongExemplarData> createLong(Clock clock, int size, java.util.function.Supplier<java.util.Random> randomSupplier)
-
createDouble
static RandomFixedSizeExemplarReservoir<DoubleExemplarData> createDouble(Clock clock, int size, java.util.function.Supplier<java.util.Random> randomSupplier)
-
-