BloombergLP::balb::RateLimiter::supportsRateLimitsExactly

Returns true if, supposing the specified sustainedRateLimit, sustainedRateWindow, peakRateLimit, and peakRateWindow are used to initialize a RateLimiter object, the corresponding query methods return the same values. The implementation of RateLimiter uses balb::LeakyBucket objects, and for some combinations of values the capacity of the balb::LeakyBucket is rounded such that the rederived values differ. Note that this method is most likely to return true when the product of each corresponding pair of limit and window (as a fraction of a second) is integral.

Synopsis

Declared in <balb_ratelimiter.h>

static
bool
supportsRateLimitsExactly(
    bsls::Types::Uint64 sustainedRateLimit,
    bsls::TimeInterval const& sustainedRateWindow,
    bsls::Types::Uint64 peakRateLimit,
    bsls::TimeInterval const& peakRateWindow);