Class EventCount

java.lang.Object
com.linecorp.armeria.client.circuitbreaker.EventCount

public final class EventCount extends Object
An immutable object that stores the count of events.
  • Field Details

  • Method Details

    • of

      public static EventCount of(long success, long failure)
      Returns a new EventCount 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 an ArithmeticException if total is 0.
    • failureRate

      public double failureRate()
      Returns the failure rate (failure/total), or throws an ArithmeticException if total is 0.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object