Class RandomFixedSizeExemplarReservoir.RandomCellSelector
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.exemplar.RandomFixedSizeExemplarReservoir.RandomCellSelector
-
- All Implemented Interfaces:
ReservoirCellSelector
- Enclosing class:
- RandomFixedSizeExemplarReservoir<T extends ExemplarData>
static class RandomFixedSizeExemplarReservoir.RandomCellSelector extends java.lang.Object implements ReservoirCellSelector
-
-
Field Summary
Fields Modifier and Type Field Description private LongAddernumMeasurementsprivate java.util.function.Supplier<java.util.Random>randomSupplier
-
Constructor Summary
Constructors Modifier Constructor Description privateRandomCellSelector(java.util.function.Supplier<java.util.Random> randomSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intreservoirCellIndex(ReservoirCell[] cells)intreservoirCellIndexFor(ReservoirCell[] cells, double value, Attributes attributes, Context context)Determine the index of thecellsto record the measurement to.intreservoirCellIndexFor(ReservoirCell[] cells, long value, Attributes attributes, Context context)Determine the index of thecellsto record the measurement to.voidreset()
-
-
-
Field Detail
-
numMeasurements
private final LongAdder numMeasurements
-
randomSupplier
private final java.util.function.Supplier<java.util.Random> randomSupplier
-
-
Method Detail
-
reservoirCellIndexFor
public int reservoirCellIndexFor(ReservoirCell[] cells, long value, Attributes attributes, Context context)
Description copied from interface:ReservoirCellSelectorDetermine the index of thecellsto record the measurement to.- Specified by:
reservoirCellIndexForin interfaceReservoirCellSelector
-
reservoirCellIndexFor
public int reservoirCellIndexFor(ReservoirCell[] cells, double value, Attributes attributes, Context context)
Description copied from interface:ReservoirCellSelectorDetermine the index of thecellsto record the measurement to.- Specified by:
reservoirCellIndexForin interfaceReservoirCellSelector
-
reservoirCellIndex
private int reservoirCellIndex(ReservoirCell[] cells)
-
reset
public void reset()
Description copied from interface:ReservoirCellSelector- Specified by:
resetin interfaceReservoirCellSelector
-
-