TrippingStrategy

nl.vroste.rezilience.TrippingStrategy
See theTrippingStrategy companion trait

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def failureCount(maxFailures: Int): ZIO[Scope, 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 parameters

maxFailures

Maximum number of failures before tripping the circuit breaker

Attributes

def failureRate(failureRateThreshold: Double, sampleDuration: Duration, minThroughput: Int, nrSampleBuckets: Int): ZIO[Scope, 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 parameters

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

Attributes