Federico Mariani created CAMEL-24135:
----------------------------------------

             Summary: camel-resilience4j - JMX getNumberOfSlowSuccessfulCalls 
returns total slow calls; console hides failure counts while failure rate is -1
                 Key: CAMEL-24135
                 URL: https://issues.apache.org/jira/browse/CAMEL-24135
             Project: Camel
          Issue Type: Bug
          Components: eip
    Affects Versions: 4.21.0
            Reporter: Federico Mariani


{{ResilienceProcessor}} JMX attribute:

{code:java}
@ManagedAttribute(description = "Returns the current number of successful calls 
which were slower than a certain threshold.")
public int getNumberOfSlowSuccessfulCalls() {
    if (circuitBreaker != null) {
        return circuitBreaker.getMetrics().getNumberOfSlowCalls();
    }
    ...
}
{code}

Copy-paste bug: it returns the *total* number of slow calls. Resilience4j 2.x 
provides {{CircuitBreaker.Metrics.getNumberOfSlowSuccessfulCalls()}} (verified 
against 2.4.0), which is what this attribute should return.

Related polish in the same area (can be fixed together): {{ResilienceConsole}} 
hard-codes {{failure: 0}} in its text output whenever {{getFailureRate() <= 
0}}, even when {{getNumberOfFailedCalls() > 0}}. Resilience4j returns *-1* 
while fewer than {{minimumNumberOfCalls}} have been recorded (default 100), 
which is exactly the window where failures accumulate, so real failure counts 
are hidden; the JSON output emits {{failureRate: -1.0}} unexplained.

_Filed by Claude Code on behalf of Federico Mariani (fmariani)_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to