public abstract class AbstractChannelMetricsHandler extends ChannelDuplexHandler
ChannelHandler
for collecting metrics on protocol level.ChannelHandler.Sharable
Modifier | Constructor and Description |
---|---|
protected |
AbstractChannelMetricsHandler(SocketAddress remoteAddress,
boolean onServer) |
Modifier and Type | Method and Description |
---|---|
void |
channelRead(ChannelHandlerContext ctx,
Object msg) |
void |
channelRegistered(ChannelHandlerContext ctx) |
abstract ChannelHandler |
connectMetricsHandler() |
void |
exceptionCaught(ChannelHandlerContext ctx,
Throwable cause) |
abstract ChannelMetricsRecorder |
recorder() |
protected void |
recordException(ChannelHandlerContext ctx,
SocketAddress address) |
protected void |
recordRead(ChannelHandlerContext ctx,
SocketAddress address,
long bytes) |
protected void |
recordWrite(ChannelHandlerContext ctx,
SocketAddress address,
long bytes) |
void |
write(ChannelHandlerContext ctx,
Object msg,
ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelInactive, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded, handlerRemoved
protected AbstractChannelMetricsHandler(@Nullable SocketAddress remoteAddress, boolean onServer)
public void channelRegistered(ChannelHandlerContext ctx)
channelRegistered
in interface ChannelInboundHandler
channelRegistered
in class ChannelInboundHandlerAdapter
public void channelRead(ChannelHandlerContext ctx, Object msg)
channelRead
in interface ChannelInboundHandler
channelRead
in class ChannelInboundHandlerAdapter
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
write
in interface ChannelOutboundHandler
write
in class ChannelDuplexHandler
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
exceptionCaught
in interface ChannelHandler
exceptionCaught
in interface ChannelInboundHandler
exceptionCaught
in class ChannelInboundHandlerAdapter
public abstract ChannelHandler connectMetricsHandler()
public abstract ChannelMetricsRecorder recorder()
protected void recordException(ChannelHandlerContext ctx, SocketAddress address)
protected void recordRead(ChannelHandlerContext ctx, SocketAddress address, long bytes)
protected void recordWrite(ChannelHandlerContext ctx, SocketAddress address, long bytes)