DRCL J-Sim API

drcl.net.tool
Class TrafficMonitor

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.comp.Extension
              extended bydrcl.comp.tool.CountMonitor
                  extended bydrcl.net.tool.TrafficMonitor
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable

public class TrafficMonitor
extends CountMonitor

This component monitors incoming traffic (packets) and outputs throughput of the traffic. The implementation is moved to CountMonitor for general applications. This component remains for backward compatibility. It keeps a fixed-size window of packets. The throughput at current time is then calculated by summing up the sizes of the packets in the current window divided by the window size. Then the results are exported every outputInterval second. The default window size is 5 seconds and the default output interval is one second.

This component can operate in either "byte" mode, "packet" mode or both. If the "byte" mode is enabled, the component exports the throughput, in the unit of bit/second, or bps, at the bytecount@ port. If the "packet" mode is enabled, it exports the throughput, in packet/second, at the pktcount@ port.

The first exported event is in the following format (drcl.comp.contract.EventMsg):

while the subsequent events are in Double.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
static java.lang.String BYTE_COUNT_EVENT
          Name of the byte-mode events.
static java.lang.String BYTE_COUNT_PORT_ID
          ID of the port to export the byte-mode events.
static java.lang.String PKT_COUNT_EVENT
          Name of the packet-mode events.
static java.lang.String PKT_COUNT_PORT_ID
          ID of the port to export the packet-mode events.
 
Fields inherited from class drcl.comp.tool.CountMonitor
OBJ_COUNT_PORT_ID, SIZE_COUNT_PORT_ID
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
TrafficMonitor()
           
TrafficMonitor(java.lang.String id_)
           
 
Methods inherited from class drcl.comp.tool.CountMonitor
configure, duplicate, getOutputInterval, getWindowSize, info, isObjModeEnabled, isSizeModeEnabled, reset, setEventNames, setObjModeEnabled, setOutputInterval, setSizeModeEnabled, setWindowSize
 
Methods inherited from class drcl.comp.Extension
isExtensionEnabled, setExtensionEnabled
 
Methods inherited from class drcl.comp.Component
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getName, getParent, getPort, getPort, getRoot, getTime, iduplicate, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PKT_COUNT_PORT_ID

public static final java.lang.String PKT_COUNT_PORT_ID
ID of the port to export the packet-mode events.

See Also:
Constant Field Values

BYTE_COUNT_PORT_ID

public static final java.lang.String BYTE_COUNT_PORT_ID
ID of the port to export the byte-mode events.

See Also:
Constant Field Values

PKT_COUNT_EVENT

public static final java.lang.String PKT_COUNT_EVENT
Name of the packet-mode events.

See Also:
Constant Field Values

BYTE_COUNT_EVENT

public static final java.lang.String BYTE_COUNT_EVENT
Name of the byte-mode events.

See Also:
Constant Field Values
Constructor Detail

TrafficMonitor

public TrafficMonitor()

TrafficMonitor

public TrafficMonitor(java.lang.String id_)

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~