SlidingWindowCircuitBreakerConfig

data class SlidingWindowCircuitBreakerConfig(val slidingWindowSize: Int = 100, val minimumNumberOfCalls: Int = 10, val failureRateThreshold: Double = 0.5, val resetTimeout: Duration = 30.seconds, val halfOpenSuccessThreshold: Int = 2)(source)

Configuration for SlidingWindowCircuitBreaker.

Constructors

Link copied to clipboard
constructor(slidingWindowSize: Int = 100, minimumNumberOfCalls: Int = 10, failureRateThreshold: Double = 0.5, resetTimeout: Duration = 30.seconds, halfOpenSuccessThreshold: Int = 2)

Properties

Link copied to clipboard

Fraction of calls in the window that must fail to trip the circuit open, from 0.0 to 1.0 (default: 0.5, i.e. 50%)

Link copied to clipboard

Number of successes needed in Half-Open state to close circuit (default: 2)

Link copied to clipboard

Minimum outcomes recorded before the failure rate is evaluated at all -- avoids tripping on a handful of unlucky early calls before the window has enough samples to be meaningful (default: 10)

Link copied to clipboard

Duration to wait before transitioning from Open to Half-Open (default: 30 seconds)

Link copied to clipboard

Number of most-recent call outcomes tracked (default: 100)