-
- All Implemented Interfaces:
-
com.datadog.android.core.sampling.Sampler
public class RateBasedSampler<T extends Object> implements Sampler<T>
Sampler with the given sample rate which can be fixed or dynamic.
-
-
Constructor Summary
Constructors Constructor Description RateBasedSampler(Float sampleRate)Creates a new instance of RateBasedSampler with the given sample rate. RateBasedSampler(Double sampleRate)Creates a new instance of RateBasedSampler with the given sample rate. RateBasedSampler(Function0<Float> sampleRateProvider)
-
Method Summary
Modifier and Type Method Description Booleansample(T item)FloatgetSampleRate()-
-
Constructor Detail
-
RateBasedSampler
RateBasedSampler(Float sampleRate)
Creates a new instance of RateBasedSampler with the given sample rate.- Parameters:
sampleRate- Sample rate to use.
-
RateBasedSampler
RateBasedSampler(Double sampleRate)
Creates a new instance of RateBasedSampler with the given sample rate.- Parameters:
sampleRate- Sample rate to use.
-
RateBasedSampler
RateBasedSampler(Function0<Float> sampleRateProvider)
- Parameters:
sampleRateProvider- Provider for the sample rate value which will be called each time the sampling decision needs to be made.
-
-
Method Detail
-
getSampleRate
Float getSampleRate()
-
-
-
-