Record Class FastCircuitBreakerConfig.NamedConfig

java.lang.Object
java.lang.Record
ru.tinkoff.kora.resilient.circuitbreaker.simple.FastCircuitBreakerConfig.NamedConfig
Enclosing class:
FastCircuitBreakerConfig

public static record FastCircuitBreakerConfig.NamedConfig(@Nullable Integer failureRateThreshold, @Nullable Duration waitDurationInOpenState, @Nullable Integer permittedCallsInHalfOpenState, @Nullable Long slidingWindowSize, @Nullable Long minimumRequiredCalls, @Nullable String failurePredicateName) extends Record
You can use Resilient4j documentation as a description of how CircuitBreaker works and how similar properties are configution its parts

failureRateThreshold Configures the failure rate threshold in percentage. If the failure rate is equal to or greater than the threshold, the CircuitBreaker transitions to open and starts short-circuiting calls. The threshold must be greater than 0 and not greater than 100. waitDurationInOpenState Configures an interval function with a fixed wait duration which controls how long the CircuitBreaker should stay open, before it switches to half open. permittedCallsInHalfOpenState Configures the number of permitted calls that must succeed when the CircuitBreaker is half open. slidingWindowSize Configures the sliding window which is used to record the outcome of calls when the CircuitBreaker is closed. minimumRequiredCalls Configures the minimum number of calls which are required (per sliding window period) before the CircuitBreaker can calculate the error rate. failurePredicateName CircuitBreakerFailurePredicate.name() default is FastCircuitBreakerFailurePredicate

  • Constructor Details

    • NamedConfig

      public NamedConfig(@Nullable Integer failureRateThreshold, @Nullable Duration waitDurationInOpenState, @Nullable Integer permittedCallsInHalfOpenState, @Nullable Long slidingWindowSize, @Nullable Long minimumRequiredCalls, @Nullable String failurePredicateName)
      Creates an instance of a NamedConfig record class.
      Parameters:
      failureRateThreshold - the value for the failureRateThreshold record component
      waitDurationInOpenState - the value for the waitDurationInOpenState record component
      permittedCallsInHalfOpenState - the value for the permittedCallsInHalfOpenState record component
      slidingWindowSize - the value for the slidingWindowSize record component
      minimumRequiredCalls - the value for the minimumRequiredCalls record component
      failurePredicateName - the value for the failurePredicateName record component
  • Method Details

    • clock

      public Clock clock()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • failureRateThreshold

      @Nullable public Integer failureRateThreshold()
      Returns the value of the failureRateThreshold record component.
      Returns:
      the value of the failureRateThreshold record component
    • waitDurationInOpenState

      @Nullable public Duration waitDurationInOpenState()
      Returns the value of the waitDurationInOpenState record component.
      Returns:
      the value of the waitDurationInOpenState record component
    • permittedCallsInHalfOpenState

      @Nullable public Integer permittedCallsInHalfOpenState()
      Returns the value of the permittedCallsInHalfOpenState record component.
      Returns:
      the value of the permittedCallsInHalfOpenState record component
    • slidingWindowSize

      @Nullable public Long slidingWindowSize()
      Returns the value of the slidingWindowSize record component.
      Returns:
      the value of the slidingWindowSize record component
    • minimumRequiredCalls

      @Nullable public Long minimumRequiredCalls()
      Returns the value of the minimumRequiredCalls record component.
      Returns:
      the value of the minimumRequiredCalls record component
    • failurePredicateName

      @Nullable public String failurePredicateName()
      Returns the value of the failurePredicateName record component.
      Returns:
      the value of the failurePredicateName record component