Top Description Inners Fields Constructors Methods
io.netty5.handler.traffic

public Class GlobalChannelTrafficCounter

extends TrafficCounter
Class Inheritance
Imports
io.netty5.handler.traffic.GlobalChannelTrafficShapingHandler.PerChannel, io.netty5.util.concurrent.EventExecutorGroup, java.util.concurrent.TimeUnit

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 and Inner Type Summary

Modifier and TypeClass and Description
private static class
GlobalChannelTrafficCounter.MixedTrafficMonitoringTask

Class to implement monitoring at fix delay.

Field Summary

Inherited from io.netty5.handler.traffic.TrafficCounter:
checkIntervalexecutorlastTimemonitormonitorActivenamescheduledFuturetrafficShapingHandler

Constructor Summary

AccessConstructor and Description
public
GlobalChannelTrafficCounter(GlobalChannelTrafficShapingHandler trafficShapingHandler, EventExecutorGroup
the underlying executor service for scheduling checks (both Global and per Channel).
executor
,
String
the name given to this monitor.
name
,
long
the checkInterval in millisecond between two computations.
checkInterval
)

Method Summary

Modifier and TypeMethod and Description
public void
resetCumulativeTime()

Overrides io.netty5.handler.traffic.TrafficCounter.resetCumulativeTime.

Reset both read and written cumulative bytes counters and the associated absolute time from System.currentTimeMillis().
public synchronized void
start()

Overrides io.netty5.handler.traffic.TrafficCounter.start.

Start the monitoring process.
public synchronized void
stop()

Overrides io.netty5.handler.traffic.TrafficCounter.stop.

Stop the monitoring process.
Inherited from io.netty5.handler.traffic.TrafficCounter:
bytesRealWriteFlowControlbytesRecvFlowControlbytesWriteFlowControlcheckIntervalconfigurecumulativeReadBytescumulativeWrittenBytescurrentReadBytescurrentWrittenBytesgetRealWriteThroughputgetRealWrittenByteslastCumulativeTimelastReadByteslastReadThroughputlastTimelastWriteThroughputlastWrittenBytesmilliSecondFromNanonamereadTimeToWaitreadTimeToWaitresetAccountingtoStringwriteTimeToWaitwriteTimeToWait

Constructor Detail

GlobalChannelTrafficCounterback to summary
public GlobalChannelTrafficCounter(GlobalChannelTrafficShapingHandler trafficShapingHandler, EventExecutorGroup executor, String name, long checkInterval)
Parameters
trafficShapingHandler:GlobalChannelTrafficShapingHandler

the associated GlobalChannelTrafficShapingHandler.

executor:EventExecutorGroup

the underlying executor service for scheduling checks (both Global and per Channel).

name:String

the name given to this monitor.

checkInterval:long

the checkInterval in millisecond between two computations.

Method Detail

resetCumulativeTimeback to summary
public void resetCumulativeTime()

Overrides io.netty5.handler.traffic.TrafficCounter.resetCumulativeTime.

Doc from io.netty5.handler.traffic.TrafficCounter.resetCumulativeTime.

Reset both read and written cumulative bytes counters and the associated absolute time from System.currentTimeMillis().

Annotations
@Override
startback to summary
public synchronized void start()

Overrides io.netty5.handler.traffic.TrafficCounter.start.

Start the monitoring process.

Annotations
@Override
stopback to summary
public synchronized void stop()

Overrides io.netty5.handler.traffic.TrafficCounter.stop.

Stop the monitoring process.

Annotations
@Override
io.netty5.handler.traffic back to summary

private Class GlobalChannelTrafficCounter.MixedTrafficMonitoringTask

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • io.netty5.handler.traffic.GlobalChannelTrafficCounter.MixedTrafficMonitoringTask
All Implemented Interfaces
java.lang.Runnable

Class to implement monitoring at fix delay. This version is Mixed in the way it mixes Global and Channel counters.

Field Summary

Modifier and TypeField and Description
private final TrafficCounter
counter

The associated TrafficCounter

private final GlobalChannelTrafficShapingHandler
trafficShapingHandler1

The associated TrafficShapingHandler

Constructor Summary

AccessConstructor and Description
pack-priv
MixedTrafficMonitoringTask(GlobalChannelTrafficShapingHandler
The parent handler to which this task needs to callback to for accounting.
trafficShapingHandler
,
TrafficCounter
The parent TrafficCounter that we need to reset the statistics for.
counter
)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

counterback to summary
private final TrafficCounter counter

The associated TrafficCounter

trafficShapingHandler1back to summary
private final GlobalChannelTrafficShapingHandler trafficShapingHandler1

The associated TrafficShapingHandler

Constructor Detail

MixedTrafficMonitoringTaskback to summary
pack-priv MixedTrafficMonitoringTask(GlobalChannelTrafficShapingHandler trafficShapingHandler, TrafficCounter counter)
Parameters
trafficShapingHandler:GlobalChannelTrafficShapingHandler

The parent handler to which this task needs to callback to for accounting.

counter:TrafficCounter

The parent TrafficCounter that we need to reset the statistics for.

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override