BCLog::LogRateLimiter::Create

Create a shared rate limiter and schedule its periodic window reset.

Synopsis

Declared in <logging.h>

static
std::shared_ptr<LogRateLimiter>
Create(
    SchedulerFunction&& scheduler_func,
    uint64_t max_bytes,
    std::chrono::seconds reset_window);

Return Value

A shared pointer to the newly created rate limiter.

Parameters

NameDescription
scheduler_funcCallable object used to schedule resetting the window. The first parameter is the function to be executed, and the second is the reset_window interval.
max_bytesMaximum number of bytes that can be logged for each source location.
reset_windowTime window after which the stats are reset.