public final class SamplingStrategies
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> |
sampleRespectRequestOrEveryN(int sampleCountHint)
Filter that samples as requested, but if there is no request will sample approximately
sampleCountHint
times. |
static java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> |
sampleUnlessFalse()
Sample unless explicitly requested to not sample.
|
static java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> |
sampleWhenRequestedOrEveryN(int sampleCountHint)
Filter that samples when requested, or otherwise treats no request and
false as the same and will filter
approximately sampleCountHint times. |
public static java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> sampleUnlessFalse()
public static java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> sampleRespectRequestOrEveryN(int sampleCountHint)
sampleCountHint
times.sampleCountHint
- Provides a hint at how many times we sample when sampling is not specified.sampleCountHint
times.public static java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> sampleWhenRequestedOrEveryN(int sampleCountHint)
false
as the same and will filter
approximately sampleCountHint
times.sampleCountHint
- Provides a hint at how many times we sample when sampling is false
or
null
.null
a sample will
be done roughly every sampleCountHint
times.