Package 

Class DeterministicSampler

  • 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 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 identifier
        sampleRate - 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 identifier
        sampleRate - 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 identifier
        sampleRateProvider - Provider for the sample rate value which will be called each time the sampling decision needs to be made.