Class HttpServerStatisticsHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

    @Sharable
    public abstract class HttpServerStatisticsHandler
    extends SimpleChannelInitializer<io.netty.channel.Channel>
    An abstract handler which may be used to examine latencies in the Netty4 HTTP request processing. It is intended to be placed immediately after HttpServerCodec or BasicHttpServerCodec handlers. When the BasicHttpServerCodec is used, the request start time is the time when the first line of the request containing the URI was received. Extend this class, overriding the complete(Stats) method to process the HttpServerStatisticsHandler.Stats objects. The instance is sharable.
       final HttpServerStatisticsHandler _stats = new HttpServerStatisticsHandler() {
         &at;Override
         protected void complete(Stats stats) {
           ...
         }
       };
    
       final ChannelHandler _initialization = new ChannelInitializer<Channel>() {
         &at;Override
         protected void initChannel(Channel ch) {
           ChannelPipeline p = ch.pipeline();
    
           ...
    
           p.addLast("http-server-codec", new HttpServerCodec());
           p.addLast("http-server-stats", _stats);
    
           ...
         }
       }
    
     
    Created by acurtis on 5/1/18.
    • Constructor Detail

      • HttpServerStatisticsHandler

        public HttpServerStatisticsHandler()