-
- All Implemented Interfaces:
-
com.datadog.android.core.sampling.Sampler
public class DeterministicSampler<T extends Object> implements Sampler<T>
Sampler with the given sample rate using a deterministic algorithm for a stable sampling decision across sources.
-
-
Constructor Summary
Constructors Constructor Description DeterministicSampler(Function1<T, ULong> idConverter, Float sampleRate)Creates a new instance lof DeterministicSampler with the given sample rate. DeterministicSampler(Function1<T, ULong> idConverter, Double sampleRate)Creates a new instance of DeterministicSampler with the given sample rate. DeterministicSampler(Function1<T, ULong> idConverter, Function0<Float> sampleRateProvider)
-
Method Summary
Modifier and Type Method Description Booleansample(T item)FloatgetSampleRate()-
-
Constructor Detail
-
DeterministicSampler
DeterministicSampler(Function1<T, ULong> idConverter, Float sampleRate)
Creates a new instance lof DeterministicSampler with the given sample rate.- Parameters:
idConverter- a lambda converting the input item into a stable numerical identifiersampleRate- Sample rate to use.
-
DeterministicSampler
DeterministicSampler(Function1<T, ULong> idConverter, Double sampleRate)
Creates a new instance of DeterministicSampler with the given sample rate.- Parameters:
idConverter- a lambda converting the input item into a stable numerical identifiersampleRate- Sample rate to use.
-
DeterministicSampler
DeterministicSampler(Function1<T, ULong> idConverter, Function0<Float> sampleRateProvider)
- Parameters:
idConverter- a lambda converting the input item into a stable numerical identifiersampleRateProvider- Provider for the sample rate value which will be called each time the sampling decision needs to be made.
-
-
Method Detail
-
getSampleRate
Float getSampleRate()
-
-
-
-