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

Create a shared rate limiter and schedule its periodic window reset&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
std::shared&lowbar;ptr&lt;LogRateLimiter&gt;
Create(
    xref:BCLog/LogRateLimiter/SchedulerFunction.adoc[SchedulerFunction]&& scheduler&lowbar;func,
    uint64&lowbar;t max&lowbar;bytes,
    std::chrono::seconds reset&lowbar;window);
----

== Return Value

A shared pointer to the newly created rate limiter&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *scheduler&lowbar;func*
| Callable object used to schedule resetting the window&period; The first parameter is the function to be executed, and the second is the reset&lowbar;window interval&period;
| *max&lowbar;bytes*
| Maximum number of bytes that can be logged for each source location&period;
| *reset&lowbar;window*
| Time window after which the stats are reset&period;
|===


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