List of usage examples for io.netty.handler.traffic TrafficCounter lastCumulativeTime
long lastCumulativeTime
To view the source code for io.netty.handler.traffic TrafficCounter lastCumulativeTime.
Click Source Link
From source file:testserver.StatisticHandler.java
License:Apache License
@Override public void close(ChannelHandlerContext ctx, ChannelPromise future) throws Exception { TrafficCounter tc = this.trafficCounter(); requestInfo.add((Long) tc.cumulativeReadBytes()); requestInfo.add((Long) tc.cumulativeWrittenBytes()); requestInfo.add((Long) (tc.cumulativeReadBytes() + tc.cumulativeWrittenBytes()) * 1000 / (System.currentTimeMillis() - tc.lastCumulativeTime())); Statistic.addFullQuery(requestInfo); Statistic.opened -= 1;/*from w w w. j a v a2s. c om*/ super.close(ctx, future); }