Top Description Fields Constructors Methods
reactor.netty.http.server

pack-priv abstract Class AbstractHttpServerMetricsHandler

extends ChannelDuplexHandler
Class Inheritance
Known Direct Subclasses
reactor.netty.http.server.ContextAwareHttpServerMetricsHandler, reactor.netty.http.server.HttpServerMetricsHandler, reactor.netty.http.server.MicrometerHttpServerMetricsHandler
Imports
io.netty.buffer.ByteBuf, .ByteBufHolder, io.netty.channel.Channel, .ChannelDuplexHandler, .ChannelHandlerContext, .ChannelPromise, io.netty.handler.codec.http.HttpRequest, .HttpResponse, .HttpResponseStatus, .LastHttpContent, io.netty.handler.codec.http2.Http2StreamChannel, reactor.netty.channel.ChannelOperations, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, java.net.SocketAddress, java.time.Duration, java.util.Collections, .HashSet, .Set, java.util.function.Function

ChannelDuplexHandler for handling HttpServer metrics.
Author
Violeta Georgieva
Since
1.0.8

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv boolean
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv static final Function<String, String>
private static final Logger
pack-priv final Function<String, String>
pack-priv static final Set<String>
pack-priv static final String
pack-priv final Function<String, String>

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
private long
protected void
protected void
protected abstract HttpServerMetricsRecorder
protected void
protected void
pack-priv void
protected void
protected void
protected void
protected void
protected void
startWrite(HttpServerOperations ops, String path, String method, String status)

public void
write(ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
,
ChannelPromise
the ChannelPromise to notify once the operation completes
promise
)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
Inherited from io.netty.channel.ChannelDuplexHandler:
bindcloseconnectderegisterdisconnectflushread

Field Detail

channelActivatedback to summary
pack-priv boolean channelActivated
channelOpenedback to summary
pack-priv boolean channelOpened
dataReceivedback to summary
pack-priv long dataReceived
dataReceivedTimeback to summary
pack-priv long dataReceivedTime
dataSentback to summary
pack-priv long dataSent
dataSentTimeback to summary
pack-priv long dataSentTime
DEFAULT_METHOD_TAG_VALUEback to summary
pack-priv static final Function<String, String> DEFAULT_METHOD_TAG_VALUE
logback to summary
private static final Logger log
methodTagValueback to summary
pack-priv final Function<String, String> methodTagValue
STANDARD_METHODSback to summary
pack-priv static final Set<String> STANDARD_METHODS
UNKNOWN_METHODback to summary
pack-priv static final String UNKNOWN_METHOD
uriTagValueback to summary
pack-priv final Function<String, String> uriTagValue

Constructor Detail

AbstractHttpServerMetricsHandlerback to summary
protected AbstractHttpServerMetricsHandler(Function<String, String> methodTagValue, Function<String, String> uriTagValue)
AbstractHttpServerMetricsHandlerback to summary
protected AbstractHttpServerMetricsHandler(AbstractHttpServerMetricsHandler copy)

Method Detail

channelActiveback to summary
public void channelActive(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelActive.

Implements io.netty.channel.ChannelInboundHandler.channelActive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelActive.

Calls ChannelHandlerContext#fireChannelActive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
channelInactiveback to summary
public void channelInactive(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Implements io.netty.channel.ChannelInboundHandler.channelInactive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Calls ChannelHandlerContext#fireChannelInactive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Implements io.netty.channel.ChannelInboundHandler.channelRead.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Calls ChannelHandlerContext#fireChannelRead(Object) to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
exceptionCaughtback to summary
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught.

Implements io.netty.channel.ChannelHandler.exceptionCaught, io.netty.channel.ChannelInboundHandler.exceptionCaught.

Doc from io.netty.channel.ChannelHandler.exceptionCaught.

Gets called if a Throwable was thrown.

Annotations
@Override
extractProcessedDataFromBufferback to summary
private long extractProcessedDataFromBuffer(Object msg)
recordActiveConnectionback to summary
protected void recordActiveConnection(SocketAddress localAddress)
recordClosedStreamback to summary
protected void recordClosedStream(SocketAddress localAddress)
recorderback to summary
protected abstract HttpServerMetricsRecorder recorder()
recordExceptionback to summary
protected void recordException(HttpServerOperations ops, String path)
recordInactiveConnectionback to summary
protected void recordInactiveConnection(SocketAddress localAddress)
recordInactiveConnectionOrStreamback to summary
pack-priv void recordInactiveConnectionOrStream(Channel channel)
recordOpenStreamback to summary
protected void recordOpenStream(SocketAddress localAddress)
recordReadback to summary
protected void recordRead(HttpServerOperations ops, String path, String method)
recordWriteback to summary
protected void recordWrite(HttpServerOperations ops, String path, String method, String status)
startReadback to summary
protected void startRead(HttpServerOperations ops, String path, String method)
startWriteback to summary
protected void startWrite(HttpServerOperations ops, String path, String method, String status)
writeback to summary
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Doc from io.netty.channel.ChannelDuplexHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelHandlerContext for which the write operation is made

msg:Object

Doc from io.netty.channel.ChannelOutboundHandler.write.

the message to write

promise:ChannelPromise

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelPromise to notify once the operation completes

Annotations
@Override
@SuppressWarnings:FutureReturnValueIgnored