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 |
channelActive(ChannelHandlerContext ctx) |
void |
channelInactive(ChannelHandlerContext ctx) |
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) |
abstract ChannelHandler |
tlsMetricsHandler() |
void |
write(ChannelHandlerContext ctx,
Object msg,
ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, read
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 channelActive(ChannelHandlerContext ctx)
channelActive
in interface ChannelInboundHandler
channelActive
in class ChannelInboundHandlerAdapter
public void channelInactive(ChannelHandlerContext ctx)
channelInactive
in interface ChannelInboundHandler
channelInactive
in class ChannelInboundHandlerAdapter
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 ChannelHandler tlsMetricsHandler()
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)