Class EventCount
java.lang.Object
com.linecorp.armeria.client.circuitbreaker.EventCount
An immutable object that stores the count of events.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EventCount
AnEventCount
without any successes and failures. -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
failure()
Returns the number of failure events.double
Returns the failure rate (failure/total), or throws anArithmeticException
if total is 0.int
hashCode()
static EventCount
of
(long success, long failure) Returns a newEventCount
with the specified number of successes and failures.long
success()
Returns the number of success events.double
Returns the success rate (success/total), or throws anArithmeticException
if total is 0.toString()
long
total()
Returns the total number of events.
-
Field Details
-
ZERO
AnEventCount
without any successes and failures.
-
-
Method Details
-
of
Returns a newEventCount
with the specified number of successes and failures. -
success
public long success()Returns the number of success events. -
failure
public long failure()Returns the number of failure events. -
total
public long total()Returns the total number of events. -
successRate
public double successRate()Returns the success rate (success/total), or throws anArithmeticException
if total is 0. -
failureRate
public double failureRate()Returns the failure rate (failure/total), or throws anArithmeticException
if total is 0. -
hashCode
public int hashCode() -
equals
-
toString
-