Package wisp.sampling

Types

Link copied to clipboard
class AlwaysSampler : Sampler
Link copied to clipboard
class PercentageSampler(samplePercentage: Int, random: () -> Int) : Sampler
Link copied to clipboard
class RateLimiter @JvmOverloads constructor(permitsPerSecond: Long, ticker: Ticker, sleeper: Sleeper)

A deterministic testable rate limiter that uses two variables:

Link copied to clipboard
class RateLimitingSampler(rateLimiter: RateLimiter) : Sampler
Link copied to clipboard
interface Sampler

A Sampler is used to "sample" whether an action is allowed to occur or not.

Link copied to clipboard
interface Sleeper

Abstraction for Thread.sleep() that allows for testing.

Link copied to clipboard
interface Ticker

Abstraction for System.nanoTime() that allows for testing.