V
- Value type that we use to adjust this metric-value.MV
- Metric value which wraps and manages the raw value.public abstract class BaseControlledMetric<V,MV extends MetricValue<V,MV>> extends Object implements ControlledMetric<V,MV>, com.j256.simplejmx.common.JmxSelfNaming, Comparable<BaseControlledMetric<V,MV>>
ControlledMetric.AggregationType
Modifier | Constructor and Description |
---|---|
protected |
BaseControlledMetric(String component,
String module,
String name,
String description,
String unit) |
Modifier and Type | Method and Description |
---|---|
void |
adjustValue(long value)
Adjust the value by a long primitive value.
|
void |
adjustValue(Number value)
Adjust the metric with this value.
|
int |
compareTo(BaseControlledMetric<V,MV> metric) |
boolean |
equals(Object obj) |
String |
getAggregationTypeName()
Return the aggregation type of the metric.
|
String |
getComponent()
Component name of the metric.
|
String |
getDescription()
Description of the component which is not persisted.
|
String |
getJmxBeanName() |
String |
getJmxDomainName() |
com.j256.simplejmx.common.JmxFolderName[] |
getJmxFolderNames() |
protected MV |
getMetricValue(boolean persisting) |
String |
getModule()
Module name of the metric or null if none.
|
String |
getName()
Component name of the metric.
|
String |
getUnit()
Unit of the metric such as percentage, megabytes, or per-second.
|
Number |
getValue()
Return the number of the metric.
|
MetricValueDetails |
getValueDetails()
Return the value details of the metric.
|
MetricValueDetails |
getValueDetailsToPersist()
Get the current value details for persisting purposes.
|
Number |
getValueToPersist()
Get the current number for persisting purposes.
|
int |
hashCode() |
protected MV |
storeValue(V value)
Stores the value into the metric.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createInitialValue, getAggregationType, makeValueFromLong, makeValueFromNumber
public Number getValue()
getValueToPersist()
if you want to save the value to disk.getValue
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public MetricValueDetails getValueDetails()
getValueDetailsToPersist()
if you want to save the value to disk.getValueDetails
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public Number getValueToPersist()
getValueToPersist
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public MetricValueDetails getValueDetailsToPersist()
getValueDetailsToPersist
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public String getAggregationTypeName()
ControlledMetric
getAggregationTypeName
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public void adjustValue(long value)
ControlledMetric
adjustValue
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public void adjustValue(Number value)
ControlledMetric
adjustValue
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public String getJmxDomainName()
getJmxDomainName
in interface com.j256.simplejmx.common.JmxSelfNaming
public String getJmxBeanName()
getJmxBeanName
in interface com.j256.simplejmx.common.JmxSelfNaming
public com.j256.simplejmx.common.JmxFolderName[] getJmxFolderNames()
getJmxFolderNames
in interface com.j256.simplejmx.common.JmxSelfNaming
public String getComponent()
ControlledMetric
getComponent
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public String getModule()
ControlledMetric
getModule
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public String getName()
ControlledMetric
getName
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public String getDescription()
ControlledMetric
getDescription
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public String getUnit()
ControlledMetric
getUnit
in interface ControlledMetric<V,MV extends MetricValue<V,MV>>
public int compareTo(BaseControlledMetric<V,MV> metric)
compareTo
in interface Comparable<BaseControlledMetric<V,MV extends MetricValue<V,MV>>>
protected MV getMetricValue(boolean persisting)
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.