Class HttpTransportTimer
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
mock_server_request_transport_duration_seconds:
from the request head being decoded to the write of the last part of its response completing on the
socket. Unlike the handler timer it includes aggregation, event-loop hand-off of a response written from
another thread, encoding, and a slow reader holding the write back.
Installed after HttpServerCodec, ahead of every handler that aggregates or answers, one instance per connection, only when metrics are
enabled. Requests are paired with responses in arrival order, as HTTP/1.1 requires, so pipelined
requests are timed separately. A 1xx response other than 101 precedes the real response
and ends nothing; a 101 turns the connection into a WebSocket and the timer removes itself.
An exchange that ends without a LastHttpContent passing through (a raw-bytes HttpError,
an abandoned exchange, a final 1xx) is announced by HttpExchangeEndedEvent: its start is
dropped unrecorded, so later exchanges on that keep-alive connection are still timed from their own start.
With its read marker added before the codec, it also times the span before that start for
mock_server_request_read_to_decode_duration_seconds: from the read that delivered a request's first bytes
(the first read after the previous request's last content was decoded, or the read that decoded it when the
next request follows in the same bytes) to the head being decoded. That covers the handlers before the codec, the
decode, a head split across reads, and pipelined requests ahead of it in the same read being handled first.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) io.netty.channel.ChannelHandlerThe handler to add before the HTTP server codec, so the read-to-decode span starts at the read.static voidremoveFrom(io.netty.channel.ChannelPipeline pipeline) Removes the timer and its read marker, if present, for when the connection stops carrying HTTP/1.1.voiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
HttpTransportTimer
public HttpTransportTimer()
-
-
Method Details
-
readMarker
public io.netty.channel.ChannelHandler readMarker()The handler to add before the HTTP server codec, so the read-to-decode span starts at the read. -
removeFrom
public static void removeFrom(io.netty.channel.ChannelPipeline pipeline) Removes the timer and its read marker, if present, for when the connection stops carrying HTTP/1.1. -
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
userEventTriggered
- Specified by:
userEventTriggeredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
userEventTriggeredin classio.netty.channel.ChannelInboundHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler
-