Module failsafe::failure_policy
source · Expand description
Contains various failure accrual policies, which are used for the failure rate detection.
Structs
A policy based on a maximum number of consecutive failure
A combinator used for join two policies into new one.
A policy based on an exponentially-weighted moving average success
rate over a time window. A moving average is used so the success rate
calculation is biased towards more recent requests.
Traits
A
FailurePolicy
is used to determine whether or not the backend died.Functions
A policy based on a maximum number of consecutive failures. If
num_failures
occur consecutively, mark_dead_on_failure
will return a Some(Duration) to
mark an endpoint dead for.Returns a policy based on an exponentially-weighted moving average success
rate over a time window. A moving average is used so the success rate
calculation is biased towards more recent requests.