module

Mosquito::RateLimiter::ClassMethods

Instance methods

metadata

Provides an instance of the metadata store used to track rate limit stats.

Source
rate_limit_key

Resolves the key used to index the metadata store for this test.

Source
rate_limit_stats

Statistics about the rate limiter, including both the configuration parameters and the run counts.

Source
throttle(*, limit : Int32 = 1, per : Time::Span = 1.second, increment = 1, key = self.name.underscore)

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.

Source