module
Mosquito::RateLimiter::ClassMethods
Defined in:
mosquito/rate_limiter.crInstance Method Summary
-
#metadata : Metadata
Provides an instance of the metadata store used to track rate limit stats.
-
#rate_limit_key
Resolves the key used to index the metadata store for this test.
-
#rate_limit_stats : NamedTuple
Statistics about the rate limiter, including both the configuration parameters and the run counts.
-
#throttle(*, limit : Int32 = 1, per : Time::Span = 1.second, increment = 1, key = self.name.underscore)
Configures rate limiting for this job.
Instance Method Detail
Provides an instance of the metadata store used to track rate limit stats.
Statistics about the rate limiter, including both the configuration parameters and the run counts.
Configures rate limiting for this job.
limit and per are used to control the run count and the window
duration. Defaults to a limit of 1 run per second.
increment is used to indicate how many "hits" against a single job is
worth. Defaults to 1.
key is used to combine rate limiting functions across multiple jobs.