Starch::Plugin::ThrottleStore - Throttle misbehaving Starch stores.
my $starch = Starch->new( plugins => ['::ThrottleStore'], store => { class => ..., throttle_threshold => 2, throttle_duration => 20, }, );
This plugin detects stores which are throwing errors consistently and disables them for a period of time.
When the "throttle_threshold" number of consecutive errors is reached all store operations will be disabled for "throttle_duration" seconds.
When the error threshold has been reached an erorr log message will be produced stating that throttling is starting. Each store access for the duration of the throttling will then produce a log message stating which state key is being throttled.
These arguments are added to classes which consume the Starch::Store role.
How many consecutive errors which will trigger throttling. Defaults to 1, which means the first error detected will begin throttling.
1
How many seconds to throttle for once the "throttle_threshold" has been reached. Default to 60 (1 minute).
60
These attributes are added to classes which consume the Starch::Store role.
Contains the current number of consecutive errors.
Contains the epoch time of when the "throttle_threshold" was passed and throttling began.
See "AUTHOR" in Starch, "CONTRIBUTORS" in Starch, and "LICENSE" in Starch.
To install Starch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Starch
CPAN shell
perl -MCPAN -e shell install Starch
For more information on module installation, please visit the detailed CPAN module installation guide.