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