public class TrafficCounter extends Object
AbstractTrafficShapingHandler
.AbstractTrafficShapingHandler
doAccounting method at every
specified interval. If this interval is set to 0, therefore no accounting will be done and only
statistics will be computed at each receive or write operations.Constructor and Description |
---|
TrafficCounter(AbstractTrafficShapingHandler trafficShapingHandler,
Timer timer,
String name,
long checkInterval)
Constructor with the
AbstractTrafficShapingHandler that hosts it, the Timer to use, its
name, the checkInterval between two computations in millisecond |
Modifier and Type | Method and Description |
---|---|
void |
configure(long newcheckInterval)
Change checkInterval between
two computations in millisecond
|
long |
getCheckInterval() |
long |
getCumulativeReadBytes() |
long |
getCumulativeWrittenBytes() |
long |
getCurrentReadBytes() |
long |
getCurrentWrittenBytes() |
long |
getLastCumulativeTime() |
long |
getLastReadBytes() |
long |
getLastReadThroughput() |
long |
getLastTime() |
long |
getLastWriteThroughput() |
long |
getLastWrittenBytes() |
String |
getName() |
void |
resetCumulativeTime()
Reset both read and written cumulative bytes counters and the associated time.
|
void |
start()
Start the monitoring process
|
void |
stop()
Stop the monitoring process
|
String |
toString()
String information
|
public TrafficCounter(AbstractTrafficShapingHandler trafficShapingHandler, Timer timer, String name, long checkInterval)
AbstractTrafficShapingHandler
that hosts it, the Timer to use, its
name, the checkInterval between two computations in millisecondtrafficShapingHandler
- the associated AbstractTrafficShapingHandlertimer
- Could be a HashedWheelTimername
- the name given to this monitorcheckInterval
- the checkInterval in millisecond between two computationspublic void start()
public void stop()
public void configure(long newcheckInterval)
newcheckInterval
- public long getCheckInterval()
public long getLastReadThroughput()
public long getLastWriteThroughput()
public long getLastReadBytes()
public long getLastWrittenBytes()
public long getCurrentReadBytes()
public long getCurrentWrittenBytes()
public long getLastTime()
public long getCumulativeWrittenBytes()
public long getCumulativeReadBytes()
public long getLastCumulativeTime()
public void resetCumulativeTime()
public String getName()
Copyright © 2008-2013 The Netty Project. All Rights Reserved.