E - The type of MetricsEvent this listener listens.public interface MetricEventsListener<E extends MetricsEvent<?>>
MetricEventsPublishers, however in that
case, there will be multiple callbacks to onSubscribe() and onCompleted()| Modifier and Type | Field and Description |
|---|---|
static int |
NO_DURATION |
static java.lang.Throwable |
NO_ERROR |
static java.util.concurrent.TimeUnit |
NO_TIME_UNIT |
static java.lang.Object |
NO_VALUE |
| Modifier and Type | Method and Description |
|---|---|
void |
onCompleted()
Marks the end of all event callbacks.
|
void |
onEvent(E event,
long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable,
java.lang.Object value)
Event callback for any
MetricsEvent. |
void |
onSubscribe()
A callback when this listener is subscribed to a
MetricEventsPublisher. |
static final int NO_DURATION
static final java.lang.Object NO_VALUE
static final java.lang.Throwable NO_ERROR
static final java.util.concurrent.TimeUnit NO_TIME_UNIT
void onEvent(E event, long duration, java.util.concurrent.TimeUnit timeUnit, java.lang.Throwable throwable, java.lang.Object value)
MetricsEvent. The parameters passed are all the contextual information possible for
any event. There presence or absence will depend on the type of event.event - Event for which this callback has been invoked. This will never be nullduration - If the passed event is MetricsEvent.isTimed() then the actual duration, else
NO_DURATIONtimeUnit - The time unit for the duration, if exists, else NO_TIME_UNITthrowable - If the passed event is MetricsEvent.isError() then the cause of the error, else
NO_ERRORvalue - If the passed event requires custom object to be passed, then that object, else NO_VALUEvoid onCompleted()
void onSubscribe()
MetricEventsPublisher.