Class DistinctSampler<K>
java.lang.Object
com.apple.foundationdb.relational.util.DistinctSampler<K>
- Type Parameters:
K
- the type of item to sample.
- All Implemented Interfaces:
Predicate<K>
A sampler which tests individual elements according to a fixed-throughput adaptive strategy.
Essentially, this logger ensures that the given item is only logged as often as a specified rate requires. It
does this by maintaining a cache of items. Upon request, if the element is not in the cache, it is logged. Otherwise,
it is logged according to the configured TokenBucketSampler
for that item, which maintains a (mostly)
constant rate of log sampling.
-
Constructor Summary
ConstructorsConstructorDescriptionDistinctSampler
(int maxSize, int maxLogsPerSecond) DistinctSampler
(int maxCacheSize, Supplier<Sampler> samplerFactory) -
Method Summary