public abstract class ServerMetricEventsListener<T extends ServerMetricsEvent<?>> extends java.lang.Object implements MetricEventsListener<T>
MetricEventsListener for receiving ServerMetricsEvent. 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 |
|---|
ServerMetricEventsListener() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
onByteRead(long bytesRead) |
void |
onCompleted()
Marks the end of all event callbacks.
|
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 |
onConnectionHandlingFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable) |
protected void |
onConnectionHandlingStart(long duration,
java.util.concurrent.TimeUnit timeUnit) |
protected void |
onConnectionHandlingSuccess(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 |
onNewClientConnected() |
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 ServerMetricsEvent<?>>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 onConnectionHandlingFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onConnectionHandlingSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onConnectionHandlingStart(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onConnectionCloseStart()
protected void onConnectionCloseSuccess(long duration,
java.util.concurrent.TimeUnit timeUnit)
protected void onConnectionCloseFailed(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable)
protected void onNewClientConnected()
protected 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()
public void onCompleted()
MetricEventsListeneronCompleted in interface MetricEventsListener<T extends ServerMetricsEvent<?>>public void onSubscribe()
MetricEventsListenerMetricEventsPublisher.onSubscribe in interface MetricEventsListener<T extends ServerMetricsEvent<?>>