|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.comp.Extension
drcl.comp.tool.CountMonitor
This component monitors an "object stream" (defined by
Countable)
and outputs average rate.
It keeps a fixed-size window of objects. The rate at current time is then
calculated by summing up the sizes of the objects 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 "size" mode, "object" mode or both.
If the "size" mode is enabled, the component exports the rate, in the unit of
the size/second, at the sizecount@ port.
If the "object" mode is enabled, it exports the rate, in object/second, at
the objcount@ port.
The first exported event is in the following format
(drcl.comp.contract.EventMsg):
#SIZE_COUNT_EVENT) or
"Average Object Rate" ("object" mode, see #OBJ_COUNT_EVENT).
Double.
null.
Double.
| 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 events. |
static java.lang.String |
SIZE_COUNT_PORT_ID
ID of the port to export the size-mode events. |
| Constructor Summary | |
CountMonitor()
|
|
CountMonitor(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 objEventName_,
java.lang.String sizeEventName_)
Sets event names for both object/size count events. |
void |
setObjModeEnabled(boolean enabled_)
Enables/disables the "object" mode. |
void |
setOutputInterval(double int_)
Sets the output interval (in second). |
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.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String OBJ_COUNT_PORT_ID
public static final java.lang.String SIZE_COUNT_PORT_ID
| Constructor Detail |
public CountMonitor()
public CountMonitor(java.lang.String id_)
| Method Detail |
public void reset()
Component
reset in class Componentpublic void duplicate(java.lang.Object source_)
Component
duplicate in interface ObjectDuplicableduplicate in class Componentpublic java.lang.String info()
Component
info in class Component
public void configure(double wsize_,
double uint_)
wsize_ - the window size in second.uint_ - the output interval in second.
public void setEventNames(java.lang.String objEventName_,
java.lang.String sizeEventName_)
public void setOutputInterval(double int_)
public double getOutputInterval()
public void setWindowSize(double size_)
public double getWindowSize()
public void setObjModeEnabled(boolean enabled_)
public boolean isObjModeEnabled()
public void setSizeModeEnabled(boolean enabled_)
public boolean isSizeModeEnabled()
|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||