Record Class FastCircuitBreakerConfig.NamedConfig
- Enclosing class:
- FastCircuitBreakerConfig
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclock()final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailurePredicateNamerecord component.Returns the value of thefailureRateThresholdrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theminimumRequiredCallsrecord component.Returns the value of thepermittedCallsInHalfOpenStaterecord component.Returns the value of theslidingWindowSizerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thewaitDurationInOpenStaterecord component.
-
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 aNamedConfigrecord class.- Parameters:
failureRateThreshold- the value for thefailureRateThresholdrecord componentwaitDurationInOpenState- the value for thewaitDurationInOpenStaterecord componentpermittedCallsInHalfOpenState- the value for thepermittedCallsInHalfOpenStaterecord componentslidingWindowSize- the value for theslidingWindowSizerecord componentminimumRequiredCalls- the value for theminimumRequiredCallsrecord componentfailurePredicateName- the value for thefailurePredicateNamerecord component
-
-
Method Details
-
clock
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
failureRateThreshold
Returns the value of thefailureRateThresholdrecord component.- Returns:
- the value of the
failureRateThresholdrecord component
-
waitDurationInOpenState
Returns the value of thewaitDurationInOpenStaterecord component.- Returns:
- the value of the
waitDurationInOpenStaterecord component
-
permittedCallsInHalfOpenState
Returns the value of thepermittedCallsInHalfOpenStaterecord component.- Returns:
- the value of the
permittedCallsInHalfOpenStaterecord component
-
slidingWindowSize
Returns the value of theslidingWindowSizerecord component.- Returns:
- the value of the
slidingWindowSizerecord component
-
minimumRequiredCalls
Returns the value of theminimumRequiredCallsrecord component.- Returns:
- the value of the
minimumRequiredCallsrecord component
-
failurePredicateName
Returns the value of thefailurePredicateNamerecord component.- Returns:
- the value of the
failurePredicateNamerecord component
-