TrippingStrategy

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def failureCount(maxFailures: Int): ZManaged[Any, Nothing, TrippingStrategy]

For a CircuitBreaker that fails when a number of successive failures (no pun intended) has been counted

For a CircuitBreaker that fails when a number of successive failures (no pun intended) has been counted

Value Params
maxFailures

Maximum number of failures before tripping the circuit breaker

def failureRate(failureRateThreshold: Double, sampleDuration: Duration, minThroughput: Int, nrSampleBuckets: Int): ZManaged[Clock, Nothing, TrippingStrategy]

For a CircuitBreaker that fails when the fraction of failures in a sample period exceeds some threshold

For a CircuitBreaker that fails when the fraction of failures in a sample period exceeds some threshold

The sample interval is divided into a number of buckets, which are rotated periodically (sampleDuration / nrSampleBuckets) to achieve a moving average of the failure rate.

Value Params
failureRateThreshold

The minimum fraction (between 0.0 and 1.0) of calls that must fail within the sample duration for the circuit breaker to trip

minThroughput

Minimum number of calls required within the sample period to evaluate the actual failure rate.

nrSampleBuckets

Nr of intervals to divide

sampleDuration

Minimum amount of time to record calls