static final class SmoothRateLimiter.SmoothBursty extends SmoothRateLimiter
SmoothRateLimiter.SmoothBursty, SmoothRateLimiter.SmoothWarmingUp
RateLimiter.SleepingStopwatch
Modifier and Type | Field and Description |
---|---|
(package private) double |
maxBurstSeconds
The work (permits) of how many seconds can be saved up if this RateLimiter is unused?
|
maxPermits, stableIntervalMicros, storedPermits
Constructor and Description |
---|
SmoothBursty(RateLimiter.SleepingStopwatch stopwatch,
double maxBurstSeconds) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
doSetRate(double permitsPerSecond,
double stableIntervalMicros) |
(package private) long |
storedPermitsToWaitTime(double storedPermits,
double permitsToTake)
Translates a specified portion of our currently stored permits which we want to
spend/acquire, into a throttling time.
|
doGetRate, doSetRate, queryEarliestAvailable, reserveEarliestAvailable
acquire, acquire, create, create, create, create, getRate, reserve, reserveAndGetWaitLength, setRate, toString, tryAcquire, tryAcquire, tryAcquire, tryAcquire
final double maxBurstSeconds
SmoothBursty(RateLimiter.SleepingStopwatch stopwatch, double maxBurstSeconds)
void doSetRate(double permitsPerSecond, double stableIntervalMicros)
doSetRate
in class SmoothRateLimiter
long storedPermitsToWaitTime(double storedPermits, double permitsToTake)
SmoothRateLimiter
This always holds: 0 <= permitsToTake <= storedPermits
storedPermitsToWaitTime
in class SmoothRateLimiter