public class RampUpRateLimiter extends AbstractRateLimiter
RampUpRateLimiter distributes permits at a ramp-up rate, in steps.
Each acquire() blocks until a permit is available.| 构造器和说明 |
|---|
RampUpRateLimiter(long maxThreshold,
long rampUpStep,
long rampUpPeriod,
TimeUnit rampUpTimeUnit,
long refillPeriod,
TimeUnit refillUnit)
Creates a
RampUpRateLimiter |
public RampUpRateLimiter(long maxThreshold,
long rampUpStep,
long rampUpPeriod,
TimeUnit rampUpTimeUnit,
long refillPeriod,
TimeUnit refillUnit)
RampUpRateLimitermaxThreshold - the max threshold that should not be overstepped.rampUpStep - the ramp-up step.rampUpPeriod - the duration of the period where the RampUpRateLimiter ramps up the threshold.rampUpTimeUnit - the time unit.refillPeriod - the duration of the period where the RampUpRateLimiter updates the bucket.refillUnit - the time unit.public void start()
AbstractRateLimiterstart 在类中 AbstractRateLimiterpublic boolean acquire()
AbstractRateLimiteracquire 在类中 AbstractRateLimiterpublic void stop()
AbstractRateLimiterstop 在类中 AbstractRateLimiterpublic boolean isStopped()
AbstractRateLimiterisStopped 在类中 AbstractRateLimiterCopyright © 2020. All rights reserved.