public class StatisticMonitoredAttribute extends MonitoredAttributeBase
StatisticsMonitoredAttribute is provided as a convenience to collect the Statistics of any entity. The getValue() call will be delegated to the StatisticsAccumulator set by the user.
Constructor and Description |
---|
StatisticMonitoredAttribute(String name,
String desc,
StatisticsAccumulator s,
Object mutex)
Constructs the StaisticMonitoredAttribute, builds the required
MonitoredAttributeInfo with Long as the class type and is always
readonly attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
clearState()
Clears the state on Statistics Accumulator, After this call all samples are
treated fresh and the old sample computations are disregarded.
|
StatisticsAccumulator |
getStatisticsAccumulator()
Gets the statistics accumulator associated with StatisticMonitoredAttribute.
|
Object |
getValue()
Gets the value from the StatisticsAccumulator, the value will be a formatted
String with the computed statistics based on the samples accumulated in the
Statistics Accumulator.
|
getAttributeInfo, getName, setValue
public StatisticMonitoredAttribute(String name, String desc, StatisticsAccumulator s, Object mutex)
Constructs the StaisticMonitoredAttribute, builds the required MonitoredAttributeInfo with Long as the class type and is always readonly attribute.
name
- Of this attribute
desc
- should provide a good description on the kind of statistics
collected, a good example is "Connection Response Time Stats will Provide the
detailed stats based on the samples provided from every request completion
time"
s
- is the StatisticsAcumulator that user will use to accumulate the
samples and this Attribute Object will get the computed statistics values
from.
mutex
- using which clearState() and getValue() calls need to be locked.
public Object getValue()
getValue
in interface MonitoredAttribute
getValue
in class MonitoredAttributeBase
public void clearState()
clearState
in interface MonitoredAttribute
clearState
in class MonitoredAttributeBase
public StatisticsAccumulator getStatisticsAccumulator()
Copyright © 2017 JBoss by Red Hat. All rights reserved.