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

Name

Description

scheduler_func

Callable 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_bytes

Maximum number of bytes that can be logged for each source location.

reset_window

Time window after which the stats are reset.

Created with MrDocs