@Override
        public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
            State state = null;

            // Reset the state as each new inbound request comes in.
            if (msg instanceof HttpRequest) {
                state = createNewState(ctx.channel());
            }

            // Update the inbound body size with this chunk.
            if (msg instanceof HttpContent) {
                if (state == null) {
                    state = getOrCreateCurrentState(ctx.channel());
                }
                state.inboundBodySize += ((HttpContent) msg).content().readableBytes();
            }

            super.channelRead(ctx, msg);
        }
User: michaels@netflix.com
Date: 4/14/16
Time: 3:51 PM
zuul-core/src/main/java/com/netflix/netty/common/metrics/HttpBodySizeRecordingChannelHandler.java