BloombergLP::balb::RateLimiter::RateLimiter

Create a rate limiter with the specified rate limits and start time.

Synopsis

Declared in <balb_ratelimiter.h>

RateLimiter(
    bsls::Types::Uint64 sustainedRateLimit,
    bsls::TimeInterval const& sustainedRateWindow,
    bsls::Types::Uint64 peakRateLimit,
    bsls::TimeInterval const& peakRateWindow,
    bsls::TimeInterval const& currentTime);

Description

Create a RateLimiter object, having the specified sustainedRateLimit, the specified sustainedRateWindow, the specified peakRateLimit, the specified peakRateWindow, and using the specified currentTime as the initial lastUpdateTime. The behavior is undefined unless 0 < sustainedRateLimit, 0 < sustainedRateWindow, 0 < peakRateLimit, 0 < peakRateWindow, the product of sustainedRateLimit and sustainedRateWindow can be represented by 64-bit unsigned integral type, and the product of peakRateLimit and peakRateWindow can be represented by 64-bit unsigned integral type.

Parameters

NameDescription
sustainedRateLimitsustained rate in units per second
sustainedRateWindowsustained-rate time-window
peakRateLimitpeak rate in units per second
peakRateWindowpeak-rate time-window
currentTimeinitial lastUpdateTime for this rate limiter