[#BCLog-LogRateLimiter]
= xref:BCLog.adoc[BCLog]::LogRateLimiter
:relfileprefix: ../
:mrdocs:

Fixed window rate limiter for logging&period;

== Synopsis

Declared in `&lt;logging&period;h&gt;`

[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&period;
|===


== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BCLog/LogRateLimiter/SchedulerFunction.adoc[`SchedulerFunction`] 
| Callback type used to schedule the periodic reset of the rate&hyphen;limit window&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BCLog/LogRateLimiter/Status.adoc[`Status`] 
| Suppression status of a source log location&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BCLog/LogRateLimiter/Consume.adoc[`Consume`] 
| Consumes `source&lowbar;loc`&apos;s available bytes corresponding to the size of the (formatted) `str` and returns its status&period;
| xref:BCLog/LogRateLimiter/Reset.adoc[`Reset`] 
| Resets all usage to zero&period; Called periodically by the scheduler&period;
| xref:BCLog/LogRateLimiter/SuppressionsActive.adoc[`SuppressionsActive`] 
| Returns true if any log locations are currently being suppressed&period;
|===


== 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&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BCLog/LogRateLimiter/m_max_bytes.adoc[`m&lowbar;max&lowbar;bytes`] 
| Maximum number of bytes logged per location per window&period;
| xref:BCLog/LogRateLimiter/m_reset_window.adoc[`m&lowbar;reset&lowbar;window`] 
| Interval after which the window is reset&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
