public final class EventCount extends Object
| Modifier and Type | Field and Description |
|---|---|
static EventCount |
ZERO
An
EventCount without any successes and failures. |
| Constructor and Description |
|---|
EventCount(long success,
long failure)
Creates a new instance with the specified number of successes and failures.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
long |
failure()
Returns the number of failure events.
|
double |
failureRate()
Returns the failure rate (failure/total), or throws an
ArithmeticException if total is 0. |
int |
hashCode() |
long |
success()
Returns the number of success events.
|
double |
successRate()
Returns the success rate (success/total), or throws an
ArithmeticException if total is 0. |
String |
toString() |
long |
total()
Returns the total number of events.
|
public static final EventCount ZERO
EventCount without any successes and failures.public EventCount(long success,
long failure)
public long success()
public long failure()
public long total()
public double successRate()
ArithmeticException if total is 0.public double failureRate()
ArithmeticException if total is 0.Copyright © 2020 LeanCloud. All rights reserved.