Class MaxSamplesPerPeriod
java.lang.Object
com.yahoo.vespa.streamingvisitors.tracing.MaxSamplesPerPeriod
- All Implemented Interfaces:
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
ConstructorDescriptionMaxSamplesPerPeriod
(MonotonicNanoClock nanoClock, long periodLengthInNanos, long maxSamplesPerPeriod) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static MaxSamplesPerPeriod
withSteadyClock
(long periodLengthInNanos, long maxSamplesPerPeriod)
-
Constructor Details
-
MaxSamplesPerPeriod
public MaxSamplesPerPeriod(MonotonicNanoClock nanoClock, long periodLengthInNanos, long maxSamplesPerPeriod)
-
-
Method Details
-
withSteadyClock
public static MaxSamplesPerPeriod withSteadyClock(long periodLengthInNanos, long maxSamplesPerPeriod) -
shouldSample
public boolean shouldSample()- Specified by:
shouldSample
in interfaceSamplingStrategy
-