public class ControlledMetricValue extends BaseControlledMetric<Double,ControlledMetricValue.ValueCount>
ControlledMetric
for metrics like number of threads running or the JVM memory usage. It is used where
you are reseting it each time as opposed to a ControlledMetricAccum
. If you need to poll a system property or
other object value then you may want your class to implement MetricsUpdater
.Modifier and Type | Class and Description |
---|---|
static class |
ControlledMetricValue.ValueCount
Wrapper around a current value and count so we can calculate averages internally.
|
ControlledMetric.AggregationType
Constructor and Description |
---|
ControlledMetricValue(String component,
String module,
String name,
String description,
String unit) |
Modifier and Type | Method and Description |
---|---|
ControlledMetricValue.ValueCount |
createInitialValue()
Create the initial value for our metric.
|
ControlledMetric.AggregationType |
getAggregationType()
Returns the type of aggregation used by this metric.
|
Double |
makeValueFromLong(long value)
Make a value type from long input.
|
Double |
makeValueFromNumber(Number value)
Make a value type from Number input.
|
adjustValue, adjustValue, compareTo, equals, getAggregationTypeName, getComponent, getDescription, getJmxBeanName, getJmxDomainName, getJmxFolderNames, getMetricValue, getModule, getName, getUnit, getValue, getValueDetails, getValueDetailsToPersist, getValueToPersist, hashCode, storeValue, toString
public ControlledMetricValue(String component, String module, String name, String description, String unit)
component
- Component short name such as "my".module
- Module name to identify the part of the component such as "pageview".name
- String label description the metric.description
- Description for more information which may not be persisted.unit
- Unit of the metric.public ControlledMetricValue.ValueCount createInitialValue()
ControlledMetric
public Double makeValueFromLong(long value)
ControlledMetric
ControlledMetric.adjustValue(long)
method.public Double makeValueFromNumber(Number value)
ControlledMetric
ControlledMetric.adjustValue(Number)
method.public ControlledMetric.AggregationType getAggregationType()
ControlledMetric
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.