BCLog::LogRateLimiter

Fixed window rate limiter for logging.

Synopsis

Declared in <logging.h>

class LogRateLimiter;

Types

NameDescription
Stats Keeps track of an individual source location and how many available bytes are left for logging from it.

Type Aliases

NameDescription
SchedulerFunction Callback type used to schedule the periodic reset of the rate-limit window.

Enums

NameDescription
Status Suppression status of a source log location.

Member Functions

NameDescription
Consume Consumes source_loc's available bytes corresponding to the size of the (formatted) str and returns its status.
Reset Resets all usage to zero. Called periodically by the scheduler.
SuppressionsActive Returns true if any log locations are currently being suppressed.

Static Member Functions

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

Data Members

NameDescription
m_max_bytes Maximum number of bytes logged per location per window.
m_reset_window Interval after which the window is reset.