public class MetricTypeValue extends MetricType
MetricTypeValue
is a value metric that can be used for
incremental counters, and other measurements, e.g. volumes, times etc.
An average, minimum and maximum may be calculated for this type of metric.
By default this type of metric will be reset at the start of a new time window.
A value of zero for a time window indicates that no updates occurred
for the metric in that time slot.
The current value will be reported at each time window if it is non-zero.
A time window is the time period for which the Gateway gathers metrics
before writing the values to the database, and resetting for the next
time window.
By default metrics are reset to zero at the start of a new time window.
MetricTypes
may be created to not reset at the
start of a new time window by setting the resetOnNewTimeWindow
flag to be false. This should be set to false for metrics which should
not be set to zero just because a new time window has begun, e.g.
systemCpuAvg. Note that a MetricType
value is always
reset when a new value is passed to it on a new time window. A
resetOnNewTimeWindow
value of false will maintain the value
from the previous time window if no values are passed to the
MetricType
for the current time window.
Examples of MetricTypeValue
are :-
increment()
method on
the MetricGroup class.
setValue()
method on
the MetricGroup class.
setValue()
method on
the MetricGroup class.
setValue()
method on
the MetricGroup class.
allowedApiMethods, avgName, maxName, minName, name, resetOnNewTimeWindow, trackCurrentValue
Constructor and Description |
---|
MetricTypeValue(java.lang.String name)
Construct a
MetricTypeValue . |
MetricTypeValue(java.lang.String name,
java.lang.String minName,
java.lang.String maxName,
java.lang.String avgName,
boolean trackCurrentValue,
boolean resetOnNewTimeWindow)
Construct a
MetricTypeValue . |
getAvgName, getMaxName, getMetricNames, getMinName, getName, getResetOnNewTimeWindow, getTrackCurrentValue, isAllowedAPIMethod, setAvgName, setMaxName, setMinName, setResetOnNewTimeWindow, setTrackCurrentValue
public MetricTypeValue(java.lang.String name)
MetricTypeValue
.
trackCurrentValue
defaults to true.name
- The name of the MetricType
. This name
is used to identify the metric when it is retrieved
via the Metrics
class, or output to the
metrics feed and database if the displayName is null.public MetricTypeValue(java.lang.String name, java.lang.String minName, java.lang.String maxName, java.lang.String avgName, boolean trackCurrentValue, boolean resetOnNewTimeWindow)
MetricTypeValue
.name
- The name of the metric. This name
is used to identify the metric when it is retrieved
via the Metrics
class, or output to the
metrics feed and database.minName
- The name for the minimum metric. If null, no minimum metric is generated.
This name is used to identify the minimum metric when it is retrieved
via the Metrics
class, or output to the
metrics feed and database.maxName
- The name for the maximum metric. If null, no maximum metric is generated.
This name is used to identify the maximum metric when it is retrieved
via the Metrics
class, or output to the
metrics feed and database.avgName
- The name for the average metric. If null, no average metric is generated.
This name is used to identify the average metric when it is retrieved
via the Metrics
class, or output to the
metrics feed and database.trackCurrentValue
- If true, the current value is tracked, i.e. is output to the
metrics feed and database, and available via the
Metrics
utility methods.
In some cases the current value is
not really of any use, e.g. cpuUsed as we have cpuUsedAvg,
cpuUsedMin and cpuUsedMax for the time window.resetOnNewTimeWindow
- If true, the metric is reset to zero when a new time window starts.
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel