Package org.jboss.netty.handler.traffic
Class GlobalChannelTrafficCounter
- java.lang.Object
-
- org.jboss.netty.handler.traffic.TrafficCounter
-
- org.jboss.netty.handler.traffic.GlobalChannelTrafficCounter
-
public class GlobalChannelTrafficCounter extends TrafficCounter
Version forGlobalChannelTrafficShapingHandler
. 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.
-
-
Constructor Summary
Constructors Constructor Description GlobalChannelTrafficCounter(GlobalChannelTrafficShapingHandler trafficShapingHandler, Timer timer, String name, long checkInterval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
resetCumulativeTime()
Reset both read and written cumulative bytes counters and the associated absolute time from System.currentTimeMillis().void
start()
Start the monitoring process.void
stop()
Stop the monitoring process.-
Methods inherited from class org.jboss.netty.handler.traffic.TrafficCounter
configure, getCheckInterval, getCumulativeReadBytes, getCumulativeWrittenBytes, getCurrentReadBytes, getCurrentWrittenBytes, getLastCumulativeTime, getLastReadBytes, getLastReadThroughput, getLastTime, getLastWriteThroughput, getLastWrittenBytes, getName, getRealWriteThroughput, getRealWrittenBytes, milliSecondFromNano, readTimeToWait, readTimeToWait, toString, writeTimeToWait, writeTimeToWait
-
-
-
-
Constructor Detail
-
GlobalChannelTrafficCounter
public GlobalChannelTrafficCounter(GlobalChannelTrafficShapingHandler trafficShapingHandler, Timer timer, String name, long checkInterval)
- Parameters:
trafficShapingHandler
- the associatedGlobalChannelTrafficShapingHandler
.name
- the name given to this monitorcheckInterval
- the checkInterval in millisecond between two computations.
-
-
Method Detail
-
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
-
-