Set the sustained and peak rate limits for this rate limiter.

Synopsis

Declared in <balb_ratelimiter.h>

void
setRateLimits(
    bsls::Types::Uint64 sustainedRateLimit,
    bsls::TimeInterval const& sustainedRateWindow,
    bsls::Types::Uint64 peakRateLimit,
    bsls::TimeInterval const& peakRateWindow);

Description

Set the sustained rate of this rate limiter to the specified sustainedRateLimit, the sustained‐rate time‐window to the specified sustainedRateWindow, the peak rate to the specified peakRateLimit and the peak‐rate time‐window to the specified peakRateWindow. 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

Name

Description

sustainedRateLimit

sustained rate in units per second

sustainedRateWindow

sustained‐rate time‐window

peakRateLimit

peak rate in units per second

peakRateWindow

peak‐rate time‐window

Created with MrDocs