public abstract class ClientMetricEventsListener<T extends ClientMetricsEvent<?>> extends java.lang.Object implements MetricEventsListener<T>
MetricEventsListener for receiving ClientMetricsEvent. This
implementation receives the events and provides convenience methods representing those events with clear arguments
that are expected with that event type.NO_DURATION, NO_ERROR, NO_TIME_UNIT, NO_VALUE| Constructor and Description |
|---|
ClientMetricEventsListener() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
onByteRead(long bytesRead) |
void |
onCompleted()
Marks the end of all event callbacks.
|
protected void |
onConnectFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable) |
protected void |
onConnectionCloseFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable) |
protected void |
onConnectionCloseStart() |
protected void |
onConnectionCloseSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit) |
protected void |
onConnectStart() |
protected void |
onConnectSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit) |
void |
onEvent(T event,
long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable,
java.lang.Object value)
Event callback for any
MetricsEvent. |
protected void |
onFlushFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable) |
protected void |
onFlushStart() |
protected void |
onFlushSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit) |
protected void |
onPoolAcquireFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable) |
protected void |
onPoolAcquireStart() |
protected void |
onPoolAcquireSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit) |
protected void |
onPooledConnectionEviction() |
protected void |
onPooledConnectionReuse(long duration,
java.util.concurrent.TimeUnit timeUnit) |
protected void |
onPoolReleaseFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable) |
protected void |
onPoolReleaseStart() |
protected void |
onPoolReleaseSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit) |
void |
onSubscribe()
A callback when this listener is subscribed to a
MetricEventsPublisher. |
protected void |
onWriteFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable) |
protected void |
onWriteStart() |
protected void |
onWriteSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit,
long bytesWritten) |
public void onEvent(T event, long duration, java.util.concurrent.TimeUnit timeUnit, java.lang.Throwable throwable, java.lang.Object value)
MetricEventsListenerMetricsEvent. The parameters passed are all the contextual information possible for
any event. There presence or absence will depend on the type of event.onEvent in interface MetricEventsListener<T extends ClientMetricsEvent<?>>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
MetricEventsListener.NO_DURATIONtimeUnit - The time unit for the duration, if exists, else MetricEventsListener.NO_TIME_UNITthrowable - If the passed event is MetricsEvent.isError() then the cause of the error, else
MetricEventsListener.NO_ERRORvalue - If the passed event requires custom object to be passed, then that object, else MetricEventsListener.NO_VALUEprotected void onByteRead(long bytesRead)
protected void onFlushFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onFlushSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onFlushStart()
protected void onWriteFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onWriteSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit,
long bytesWritten)
protected void onWriteStart()
protected void onPoolReleaseFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onPoolReleaseSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onPoolReleaseStart()
protected void onPooledConnectionEviction()
protected void onPooledConnectionReuse(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onPoolAcquireFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onPoolAcquireSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onPoolAcquireStart()
protected void onConnectionCloseFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onConnectionCloseSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onConnectionCloseStart()
protected void onConnectFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onConnectSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onConnectStart()
public void onCompleted()
MetricEventsListeneronCompleted in interface MetricEventsListener<T extends ClientMetricsEvent<?>>public void onSubscribe()
MetricEventsListenerMetricEventsPublisher.onSubscribe in interface MetricEventsListener<T extends ClientMetricsEvent<?>>