LiveLoad.Scenario.Throttle.Interarrival provides a rate limiter which enforces a set amount of time between events.
Examples
# One event every 500 milliseconds
LiveLoad.Scenario.Throttle.Interarrival.new(:my_throttle, to_timeout(millisecond: 500))
# One event every 2 seconds
LiveLoad.Scenario.Throttle.Interarrival.new(:my_throttle, to_timeout(second: 2))
# Start at 1 event per second and ramp up over the next 2 minutes
LiveLoad.Scenario.Throttle.Interarrival.new(:my_throttle, to_timeout(second: 1))
|> LiveLoad.Scenario.Throttle.Interarrival.ramp(100, duration: to_timeout(minute: 2))
Summary
Functions
Creates a new LiveLoad.Scenario.Throttle.Interarrival with the given name and time between events.
Attaches a gradually ramping interarrival change to the throttle.
Types
@opaque t()
@type time_between() :: pos_integer()
Functions
@spec new(name :: atom(), time_between :: time_between()) :: t()
Creates a new LiveLoad.Scenario.Throttle.Interarrival with the given name and time between events.
@spec ramp( interarrival :: t(), target :: LiveLoad.Scenario.Throttle.Ramp.target(), ramp_opts :: [LiveLoad.Scenario.Throttle.Ramp.option()] ) :: t()
Attaches a gradually ramping interarrival change to the throttle.
Target defines the target interarrival in milliseconds.
Options
:duration: The duration of the gradual ramp up in milliseconds:steps: The number of steps to take while ramping up. Requires am:intervalvalue.:interval: The interval at which to take each step. Requires a:stepvalue.