Package io.netty.handler.traffic
Class GlobalChannelTrafficCounter
java.lang.Object
io.netty.handler.traffic.TrafficCounter
io.netty.handler.traffic.GlobalChannelTrafficCounter
Version for
GlobalChannelTrafficShapingHandler
.
This TrafficCounter is the Global one, and its special property is to directly handle
other channel's TrafficCounters. In particular, there are no scheduler for those
channel's TrafficCounters because it is managed by this one.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Class to implement monitoring at fix delay. -
Field Summary
Fields inherited from class io.netty.handler.traffic.TrafficCounter
checkInterval, executor, lastTime, monitor, monitorActive, name, scheduledFuture, trafficShapingHandler
-
Constructor Summary
ConstructorsConstructorDescriptionGlobalChannelTrafficCounter
(GlobalChannelTrafficShapingHandler trafficShapingHandler, ScheduledExecutorService executor, String name, long checkInterval) -
Method Summary
Methods inherited from class io.netty.handler.traffic.TrafficCounter
bytesRealWriteFlowControl, bytesRecvFlowControl, bytesWriteFlowControl, checkInterval, configure, cumulativeReadBytes, cumulativeWrittenBytes, currentReadBytes, currentWrittenBytes, getRealWriteThroughput, getRealWrittenBytes, lastCumulativeTime, lastReadBytes, lastReadThroughput, lastTime, lastWriteThroughput, lastWrittenBytes, milliSecondFromNano, name, readTimeToWait, readTimeToWait, resetAccounting, toString, writeTimeToWait, writeTimeToWait
-
Constructor Details
-
GlobalChannelTrafficCounter
public GlobalChannelTrafficCounter(GlobalChannelTrafficShapingHandler trafficShapingHandler, ScheduledExecutorService executor, String name, long checkInterval) - Parameters:
trafficShapingHandler
- the associatedGlobalChannelTrafficShapingHandler
.executor
- the underlying executor service for scheduling checks (both Global and per Channel).name
- the name given to this monitor.checkInterval
- the checkInterval in millisecond between two computations.
-
-
Method Details
-
start
public void start()Start the monitoring process.- Overrides:
start
in classTrafficCounter
-
stop
public void stop()Stop the monitoring process.- Overrides:
stop
in classTrafficCounter
-
resetCumulativeTime
public void resetCumulativeTime()Description copied from class:TrafficCounter
Reset both read and written cumulative bytes counters and the associated absolute time from System.currentTimeMillis().- Overrides:
resetCumulativeTime
in classTrafficCounter
-