DRCL J-Sim API

drcl.comp.tool
Class CountMonitor2

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.comp.Extension
              extended bydrcl.comp.tool.CountMonitor2
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable
Direct Known Subclasses:
TrafficMonitor2

public class CountMonitor2
extends Extension

This component monitors an "object stream" (defined by Countable) and outputs its average rate and object loss rate. This component works the same as CountMonitor except that it also calculates object loss rate in the current time window, provided that the objects contain correct "sequence" information as defined in Countable. It calculates the loss rate by summing up the "gaps" found between the ordering information in the objects in the current time window. The calculation may not be correct if objects may arrive out of order in different windows.

Same as CountMonitor, this component is configured by two parameters: the window size (default one second) and the output interval (default 0.5 second). It can operate in the "size" mode, the "object" mode, or both. The throughput events are exported at either the sizecount@ port or the objcount@ port, and the loss rate exported at either the sizeloss@ port or the objloss@ port, both in percentage(%).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
static java.lang.String OBJ_COUNT_PORT_ID
          ID of the port to export the object-mode throughput events.
static java.lang.String OBJ_LOSS_PORT_ID
          ID of the port to export the object-mode object-loss-rate events.
static java.lang.String SIZE_COUNT_PORT_ID
          ID of the port to export the size-mode throughput events.
static java.lang.String SIZE_LOSS_PORT_ID
          ID of the port to export the size-mode object-loss-rate events.
 
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
CountMonitor2()
           
CountMonitor2(java.lang.String id_)
           
 
Method Summary
 void configure(double wsize_, double uint_)
          Configures this traffic monitor.
 void duplicate(java.lang.Object source_)
          Duplicates the content of source_, including ID, name, child components and connections among them, to this component.
 double getOutputInterval()
          Returns the output interval (in second).
 double getWindowSize()
          Returns the size of the measurement window (in second).
 java.lang.String info()
          Returns information regarding this component.
 boolean isObjModeEnabled()
          Returns true if the "object" mode is enabled.
 boolean isSizeModeEnabled()
          Returns true if the "size" mode is enabled.
 void reset()
          Resets the component for being used anew.
 void setEventNames(java.lang.String objCountEvent_, java.lang.String objLossEvent_, java.lang.String sizeCountEvent_, java.lang.String sizeLossEvent_)
          Sets the event names to be outputted with the report events.
 void setObjectEventNames(java.lang.String objCountEvent_, java.lang.String objLossEvent_)
          Sets the "object" event names to be outputted with the report events.
 void setObjModeEnabled(boolean enabled_)
          Enables/disables the "object" mode.
 void setOutputInterval(double int_)
          Sets the output interval (in second).
 void setSizeEventNames(java.lang.String sizeCountEvent_, java.lang.String sizeLossEvent_)
          Sets the "size" event names to be outputted with the report events.
 void setSizeModeEnabled(boolean enabled_)
          Enables/disables the "size" mode.
 void setWindowSize(double size_)
          Sets the size of the measurement window (in second).
 
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

OBJ_COUNT_PORT_ID

public static final java.lang.String OBJ_COUNT_PORT_ID
ID of the port to export the object-mode throughput events.

See Also:
Constant Field Values

OBJ_LOSS_PORT_ID

public static final java.lang.String OBJ_LOSS_PORT_ID
ID of the port to export the object-mode object-loss-rate events.

See Also:
Constant Field Values

SIZE_COUNT_PORT_ID

public static final java.lang.String SIZE_COUNT_PORT_ID
ID of the port to export the size-mode throughput events.

See Also:
Constant Field Values

SIZE_LOSS_PORT_ID

public static final java.lang.String SIZE_LOSS_PORT_ID
ID of the port to export the size-mode object-loss-rate events.

See Also:
Constant Field Values
Constructor Detail

CountMonitor2

public CountMonitor2()

CountMonitor2

public CountMonitor2(java.lang.String id_)
Method Detail

reset

public void reset()
Description copied from class: Component
Resets the component for being used anew. All the internal variables must be set to the initial state. All the ports and child components are reset as well.

Overrides:
reset in class Component

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: Component
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. Subclasses need to override this method to copy its own variables.

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class Component

info

public java.lang.String info()
Description copied from class: Component
Returns information regarding this component. Subclasses should override this method to provide useful information at run time.

Overrides:
info in class Component

configure

public void configure(double wsize_,
                      double uint_)
Configures this traffic monitor.

Parameters:
wsize_ - the window size in second.
uint_ - the output interval in second.

setEventNames

public void setEventNames(java.lang.String objCountEvent_,
                          java.lang.String objLossEvent_,
                          java.lang.String sizeCountEvent_,
                          java.lang.String sizeLossEvent_)
Sets the event names to be outputted with the report events.


setObjectEventNames

public void setObjectEventNames(java.lang.String objCountEvent_,
                                java.lang.String objLossEvent_)
Sets the "object" event names to be outputted with the report events.


setSizeEventNames

public void setSizeEventNames(java.lang.String sizeCountEvent_,
                              java.lang.String sizeLossEvent_)
Sets the "size" event names to be outputted with the report events.


setOutputInterval

public void setOutputInterval(double int_)
Sets the output interval (in second).


getOutputInterval

public double getOutputInterval()
Returns the output interval (in second).


setWindowSize

public void setWindowSize(double size_)
Sets the size of the measurement window (in second).


getWindowSize

public double getWindowSize()
Returns the size of the measurement window (in second).


setObjModeEnabled

public void setObjModeEnabled(boolean enabled_)
Enables/disables the "object" mode.


isObjModeEnabled

public boolean isObjModeEnabled()
Returns true if the "object" mode is enabled.


setSizeModeEnabled

public void setSizeModeEnabled(boolean enabled_)
Enables/disables the "size" mode.


isSizeModeEnabled

public boolean isSizeModeEnabled()
Returns true if the "size" mode is enabled.


DRCL J-Sim API

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