Class MaxSamplesPerPeriod
- java.lang.Object
-
- com.yahoo.vespa.streamingvisitors.tracing.MaxSamplesPerPeriod
-
- All Implemented Interfaces:
SamplingStrategy
public class MaxSamplesPerPeriod extends java.lang.Object implements SamplingStrategy
Very basic sampling strategy which allows for sampling N requests within a fixed time window. No attempt is made to distribute the samples evenly within the time period; this is on a first-come, first-serve basis.
-
-
Constructor Summary
Constructors Constructor Description MaxSamplesPerPeriod(MonotonicNanoClock nanoClock, long periodLengthInNanos, long maxSamplesPerPeriod)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldSample()
static MaxSamplesPerPeriod
withSteadyClock(long periodLengthInNanos, long maxSamplesPerPeriod)
-
-
-
Constructor Detail
-
MaxSamplesPerPeriod
public MaxSamplesPerPeriod(MonotonicNanoClock nanoClock, long periodLengthInNanos, long maxSamplesPerPeriod)
-
-
Method Detail
-
withSteadyClock
public static MaxSamplesPerPeriod withSteadyClock(long periodLengthInNanos, long maxSamplesPerPeriod)
-
shouldSample
public boolean shouldSample()
- Specified by:
shouldSample
in interfaceSamplingStrategy
-
-