Class CircuitBreakerConfig


  • public class CircuitBreakerConfig
    extends Object
    Allows configuring a CircuitBreaker.
    Since:
    2.0.0
    • Field Detail

      • DEFAULT_VOLUME_THRESHOLD

        public static final int DEFAULT_VOLUME_THRESHOLD
        See Also:
        Constant Field Values
      • DEFAULT_ERROR_THRESHOLD_PERCENTAGE

        public static final int DEFAULT_ERROR_THRESHOLD_PERCENTAGE
        See Also:
        Constant Field Values
      • DEFAULT_SLEEP_WINDOW

        public static final Duration DEFAULT_SLEEP_WINDOW
      • DEFAULT_ROLLING_WINDOW

        public static final Duration DEFAULT_ROLLING_WINDOW
    • Method Detail

      • enabled

        public boolean enabled()
        Returns true if this circuit breaker is enabled.
      • volumeThreshold

        public int volumeThreshold()
        Returns the volume threshold at which point the circuit will decide if it opens.
      • errorThresholdPercentage

        public int errorThresholdPercentage()
        Returns the configured error threshold percentage after which the circuit possibly opens.
      • sleepWindow

        public Duration sleepWindow()
        Returns the configured sleep window after which a canary is allowed to go through.
      • rollingWindow

        public Duration rollingWindow()
        Returns the configured rolling window duration which is considered to track the failed ops.