[#BCLog-LogRateLimiter] = xref:BCLog.adoc[BCLog]::LogRateLimiter :relfileprefix: ../ :mrdocs: Fixed window rate limiter for logging. == Synopsis Declared in `<logging.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class LogRateLimiter; ---- == Types [cols="1,4"] |=== | Name| Description | xref:BCLog/LogRateLimiter/Stats.adoc[`Stats`] | Keeps track of an individual source location and how many available bytes are left for logging from it. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BCLog/LogRateLimiter/SchedulerFunction.adoc[`SchedulerFunction`] | Callback type used to schedule the periodic reset of the rate‐limit window. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BCLog/LogRateLimiter/Status.adoc[`Status`] | Suppression status of a source log location. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BCLog/LogRateLimiter/Consume.adoc[`Consume`] | Consumes `source_loc`'s available bytes corresponding to the size of the (formatted) `str` and returns its status. | xref:BCLog/LogRateLimiter/Reset.adoc[`Reset`] | Resets all usage to zero. Called periodically by the scheduler. | xref:BCLog/LogRateLimiter/SuppressionsActive.adoc[`SuppressionsActive`] | Returns true if any log locations are currently being suppressed. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BCLog/LogRateLimiter/Create.adoc[`Create`] | Create a shared rate limiter and schedule its periodic window reset. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:BCLog/LogRateLimiter/m_max_bytes.adoc[`m_max_bytes`] | Maximum number of bytes logged per location per window. | xref:BCLog/LogRateLimiter/m_reset_window.adoc[`m_reset_window`] | Interval after which the window is reset. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#