A counter monitor sends a threshold
notification
when the value of the counter reaches or exceeds a
threshold known as the comparison level. The notify flag must be
set to true
.
In addition, an offset mechanism enables particular counting intervals to be detected. If the offset value is not zero, whenever the threshold is triggered by the counter value reaching a comparison level, that comparison level is incremented by the offset value. This is regarded as taking place instantaneously, that is, before the count is incremented. Thus, for each level, the threshold triggers an event notification every time the count increases by an interval equal to the offset value.
If the counter can wrap around its maximum value, the modulus needs to be specified. The modulus is the value at which the counter is reset to zero.
If the counter difference mode is used, the value of the derived gauge is calculated as the difference between the observed counter values for two successive observations. If this difference is negative, the value of the derived gauge is incremented by the value of the modulus. The derived gauge value (V[t]) is calculated using the following method:
Byte
,
Integer
, Short
, Long
).
Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private boolean | differenceMode
Flag indicating if the counter difference mode is used. |
private Number | initThreshold
Initial counter threshold. |
private Number | modulus
Counter modulus. |
private static final MBeanNotificationInfo[] | |
private boolean | notify
Flag indicating if the counter monitor notifies when exceeding the threshold. |
private Number | offset
Counter offset. |
private static final String[] |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
pack-priv synchronized MonitorNotification | buildAlarmNotification(ObjectName object, String attribute, Comparable<?> value)
Overrides javax.
|
pack-priv Monitor. | createObservedObject(ObjectName object)
Overrides javax. Factory method for ObservedObject creation. |
public synchronized Number | Returns: The derived gauge of the specified object.the name of the object whose derived gauge is to
be returned. object)Overrides javax. Implements javax. Gets the derived gauge of the specified object, if this object is
contained in the set of observed MBeans, or |
public synchronized Number | Returns: The derived gauge.Implements javax.
Deprecated
As of JMX 1.2, replaced by
getDerivedGauge(ObjectName)
Returns the derived gauge of the first object in the set of observed MBeans. |
pack-priv synchronized Comparable | getDerivedGaugeFromComparable(ObjectName object, String attribute, Comparable<?> value)
Overrides javax.
|
public synchronized long | Returns: The derived gauge timestamp of the specified object.the name of the object whose derived gauge
timestamp is to be returned. object)Overrides javax. Implements javax. Gets the derived gauge timestamp of the specified object, if
this object is contained in the set of observed MBeans, or
|
public synchronized long | Returns: The derived gauge timestamp.Implements javax.
Deprecated
As of JMX 1.2, replaced by
getDerivedGaugeTimeStamp(ObjectName)
Gets the derived gauge timestamp of the first object in the set of observed MBeans. |
public synchronized boolean | Returns: true if the difference mode is used,
false otherwise.Implements javax. Gets the difference mode flag value common to all observed MBeans. |
public synchronized Number | Returns: The initial threshold.Implements javax. Gets the initial threshold value common to all observed objects. |
public synchronized Number | Returns: The modulus value.Implements javax. Gets the modulus value common to all observed MBeans. |
public MBeanNotificationInfo[] | getNotificationInfo()
Overrides javax. Implements javax. Returns a |
public synchronized boolean | Returns: true if the counter monitor notifies when
exceeding the threshold, false otherwise.Implements javax. Gets the notification's on/off switch value common to all observed MBeans. |
public synchronized Number | Returns: The offset value.Implements javax. Gets the offset value common to all observed MBeans. |
public synchronized Number | Returns: The threshold value of the specified object.the name of the object whose threshold is to be
returned. object)Implements javax. Gets the current threshold value of the specified object, if
this object is contained in the set of observed MBeans, or
|
public synchronized Number | Returns: The threshold value.Implements javax.
Deprecated
As of JMX 1.2, replaced by
getThreshold(ObjectName)
Gets the threshold value of the first object in the set of observed MBeans. |
pack-priv synchronized boolean | isComparableTypeValid(ObjectName object, String attribute, Comparable<?> value)
Overrides javax. This method globally sets the derived gauge type for the given "object" and "attribute" after checking that the type of the supplied observed attribute value is one of the value types supported by this monitor. |
pack-priv synchronized boolean | Returns: true if type is the same,
false otherwise.The observed object. object, String The observed attribute. attribute, Comparable<?> The sample value. value)Overrides javax. Tests if the threshold, offset and modulus of the specified observed object are of the same type as the counter. |
pack-priv synchronized void | onErrorNotification(MonitorNotification notification)
Overrides javax.
|
private synchronized void | setDerivedGaugeWithDifference(Number
The value of the observed attribute. scanCounter, Number The counter modulus value. mod, CounterMonitor.The observed object. oSets the derived gauge of the specified observed object when the
differenceMode flag is set to |
public synchronized void | setDifferenceMode(boolean
The difference mode flag value. value)Implements javax. Sets the difference mode flag value common to all observed MBeans. |
public synchronized void | setInitThreshold(Number
The initial threshold value. value)Implements javax. Sets the initial threshold value common to all observed objects. |
public synchronized void | setModulus(Number
The modulus value. value)Implements javax. Sets the modulus value common to all observed MBeans. |
public synchronized void | setNotify(boolean
The notification's on/off switch value. value)Implements javax. Sets the notification's on/off switch value common to all observed MBeans. |
public synchronized void | setOffset(Number
The offset value. value)Implements javax. Sets the offset value common to all observed MBeans. |
public synchronized void | setThreshold(Number
The initial threshold value. value)Implements javax.
Deprecated
As of JMX 1.2, replaced by
setInitThreshold
Sets the initial threshold value. |
public synchronized void | start()
Implements abstract javax. Implements javax. Starts the counter monitor. |
public synchronized void | stop()
Implements abstract javax. Implements javax. Stops the counter monitor. |
private synchronized boolean | Returns: true if the derived gauge value is valid,
false otherwise. The derived gauge value is
invalid when the differenceMode flag is set to
true and it is the first notification (so we
haven't 2 consecutive values to update the derived gauge).The value of the observed attribute. scanCounter, CounterMonitor.The observed object. oUpdates the derived gauge attribute of the observed object. |
private synchronized MonitorNotification | updateNotifications(CounterMonitor.
The observed object. oUpdates the notification attribute of the observed object
and notifies the listeners only once if the notify flag
is set to |
private synchronized void | updateThreshold(CounterMonitor.
The observed object. oUpdates the threshold attribute of the observed object. |
differenceMode | back to summary |
---|---|
private boolean differenceMode Flag indicating if the counter difference mode is used. If the
counter difference mode is used, the derived gauge is the
difference between two consecutive observed values. Otherwise,
the derived gauge is directly the value of the observed
attribute. The default value is set to |
initThreshold | back to summary |
---|---|
private Number initThreshold Initial counter threshold. This value is used to initialize the threshold when a new object is added to the list and reset the threshold to its initial value each time the counter resets. |
modulus | back to summary |
---|---|
private Number modulus Counter modulus.
|
notifsInfo | back to summary |
---|---|
private static final MBeanNotificationInfo[] notifsInfo |
notify | back to summary |
---|---|
private boolean notify Flag indicating if the counter monitor notifies when exceeding
the threshold. The default value is set to
|
offset | back to summary |
---|---|
private Number offset Counter offset.
|
types | back to summary |
---|---|
private static final String[] types |
CounterMonitor | back to summary |
---|---|
public CounterMonitor() Default constructor. |
buildAlarmNotification | back to summary |
---|---|
pack-priv synchronized MonitorNotification buildAlarmNotification(ObjectName object, String attribute, Comparable<?> value) Overrides javax.
|
createObservedObject | back to summary |
---|---|
pack-priv Monitor. Overrides javax. Factory method for ObservedObject creation.
|
getDerivedGauge | back to summary |
---|---|
public synchronized Number getDerivedGauge(ObjectName object) Overrides javax. Implements javax. Gets the derived gauge of the specified object, if this object is
contained in the set of observed MBeans, or
|
getDerivedGauge | back to summary |
---|---|
public synchronized Number getDerivedGauge() Implements javax. Deprecated As of JMX 1.2, replaced by
Returns the derived gauge of the first object in the set of observed MBeans.
|
getDerivedGaugeFromComparable | back to summary |
---|---|
pack-priv synchronized Comparable Overrides javax.
|
getDerivedGaugeTimeStamp | back to summary |
---|---|
public synchronized long getDerivedGaugeTimeStamp(ObjectName object) Overrides javax. Implements javax. Gets the derived gauge timestamp of the specified object, if
this object is contained in the set of observed MBeans, or
|
getDerivedGaugeTimeStamp | back to summary |
---|---|
public synchronized long getDerivedGaugeTimeStamp() Implements javax. Deprecated As of JMX 1.2, replaced by
Gets the derived gauge timestamp of the first object in the set of observed MBeans.
|
getDifferenceMode | back to summary |
---|---|
public synchronized boolean getDifferenceMode() Implements javax. Gets the difference mode flag value common to all observed MBeans.
|
getInitThreshold | back to summary |
---|---|
public synchronized Number getInitThreshold() Implements javax. Gets the initial threshold value common to all observed objects.
|
getModulus | back to summary |
---|---|
public synchronized Number getModulus() Implements javax. Gets the modulus value common to all observed MBeans.
|
getNotificationInfo | back to summary |
---|---|
public MBeanNotificationInfo[] getNotificationInfo() Overrides javax. Implements javax. Returns a
|
getNotify | back to summary |
---|---|
public synchronized boolean getNotify() Implements javax. Gets the notification's on/off switch value common to all observed MBeans.
|
getOffset | back to summary |
---|---|
public synchronized Number getOffset() Implements javax. Gets the offset value common to all observed MBeans. |
getThreshold | back to summary |
---|---|
public synchronized Number getThreshold(ObjectName object) Implements javax. Gets the current threshold value of the specified object, if
this object is contained in the set of observed MBeans, or
|
getThreshold | back to summary |
---|---|
public synchronized Number getThreshold() Implements javax. Deprecated As of JMX 1.2, replaced by Gets the threshold value of the first object in the set of observed MBeans.
|
isComparableTypeValid | back to summary |
---|---|
pack-priv synchronized boolean isComparableTypeValid(ObjectName object, String attribute, Comparable<?> value) Overrides javax. This method globally sets the derived gauge type for the given "object" and "attribute" after checking that the type of the supplied observed attribute value is one of the value types supported by this monitor.
|
isThresholdTypeValid | back to summary |
---|---|
pack-priv synchronized boolean isThresholdTypeValid(ObjectName object, String attribute, Comparable<?> value) Overrides javax. Tests if the threshold, offset and modulus of the specified observed object are of the same type as the counter. Only integer types are allowed. Note If the optional offset or modulus have not been initialized, their default value is an Integer object with a value equal to zero.
|
onErrorNotification | back to summary |
---|---|
pack-priv synchronized void onErrorNotification(MonitorNotification notification) Overrides javax.
|
setDerivedGaugeWithDifference | back to summary |
---|---|
private synchronized void setDerivedGaugeWithDifference(Number scanCounter, Number mod, CounterMonitor. Sets the derived gauge of the specified observed object when the
differenceMode flag is set to
|
setDifferenceMode | back to summary |
---|---|
public synchronized void setDifferenceMode(boolean value) Implements javax. Sets the difference mode flag value common to all observed MBeans.
|
setInitThreshold | back to summary |
---|---|
public synchronized void setInitThreshold(Number value) throws IllegalArgumentException Implements javax. Sets the initial threshold value common to all observed objects.
|
setModulus | back to summary |
---|---|
public synchronized void setModulus(Number value) throws IllegalArgumentException Implements javax. Sets the modulus value common to all observed MBeans.
|
setNotify | back to summary |
---|---|
public synchronized void setNotify(boolean value) Implements javax. Sets the notification's on/off switch value common to all observed MBeans.
|
setOffset | back to summary |
---|---|
public synchronized void setOffset(Number value) throws IllegalArgumentException Implements javax. Sets the offset value common to all observed MBeans.
|
setThreshold | back to summary |
---|---|
public synchronized void setThreshold(Number value) throws IllegalArgumentException Implements javax. Deprecated As of JMX 1.2, replaced by Sets the initial threshold value.
|
start | back to summary |
---|---|
public synchronized void start() Implements abstract javax. Implements javax. Starts the counter monitor. |
stop | back to summary |
---|---|
public synchronized void stop() Implements abstract javax. Implements javax. Stops the counter monitor. |
updateDerivedGauge | back to summary |
---|---|
private synchronized boolean updateDerivedGauge(Object scanCounter, CounterMonitor. Updates the derived gauge attribute of the observed object.
|
updateNotifications | back to summary |
---|---|
private synchronized MonitorNotification updateNotifications(CounterMonitor. Updates the notification attribute of the observed object
and notifies the listeners only once if the notify flag
is set to
|
updateThreshold | back to summary |
---|---|
private synchronized void updateThreshold(CounterMonitor. Updates the threshold attribute of the observed object.
|
Modifier and Type | Field and Description |
---|---|
private Number | |
private boolean | |
private boolean | |
private boolean | |
private Number | |
private Number | |
private Monitor. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public final synchronized Number | |
public final synchronized boolean | |
public final synchronized boolean | |
public final synchronized boolean | |
public final synchronized Number | |
public final synchronized Number | |
public final synchronized Monitor. | |
public final synchronized void | |
public final synchronized void | |
public final synchronized void | |
public final synchronized void | |
public final synchronized void | |
public final synchronized void | |
public final synchronized void |
derivedGaugeExceeded | back to summary |
---|---|
private Number derivedGaugeExceeded |
derivedGaugeValid | back to summary |
---|---|
private boolean derivedGaugeValid |
eventAlreadyNotified | back to summary |
---|---|
private boolean eventAlreadyNotified |
modulusExceeded | back to summary |
---|---|
private boolean modulusExceeded |
previousScanCounter | back to summary |
---|---|
private Number previousScanCounter |
threshold | back to summary |
---|---|
private Number threshold |
type | back to summary |
---|---|
private Monitor. |
CounterMonitorObservedObject | back to summary |
---|---|
public CounterMonitorObservedObject(ObjectName observedObject) |
getDerivedGaugeExceeded | back to summary |
---|---|
public final synchronized Number getDerivedGaugeExceeded() |
getDerivedGaugeValid | back to summary |
---|---|
public final synchronized boolean getDerivedGaugeValid() |
getEventAlreadyNotified | back to summary |
---|---|
public final synchronized boolean getEventAlreadyNotified() |
getModulusExceeded | back to summary |
---|---|
public final synchronized boolean getModulusExceeded() |
getPreviousScanCounter | back to summary |
---|---|
public final synchronized Number getPreviousScanCounter() |
getThreshold | back to summary |
---|---|
public final synchronized Number getThreshold() |
getType | back to summary |
---|---|
public final synchronized Monitor. |
setDerivedGaugeExceeded | back to summary |
---|---|
public final synchronized void setDerivedGaugeExceeded(Number derivedGaugeExceeded) |
setDerivedGaugeValid | back to summary |
---|---|
public final synchronized void setDerivedGaugeValid(boolean derivedGaugeValid) |
setEventAlreadyNotified | back to summary |
---|---|
public final synchronized void setEventAlreadyNotified(boolean eventAlreadyNotified) |
setModulusExceeded | back to summary |
---|---|
public final synchronized void setModulusExceeded(boolean modulusExceeded) |
setPreviousScanCounter | back to summary |
---|---|
public final synchronized void setPreviousScanCounter(Number previousScanCounter) |
setThreshold | back to summary |
---|---|
public final synchronized void setThreshold(Number threshold) |
setType | back to summary |
---|---|
public final synchronized void setType(Monitor. |