public class ControlledMetricAccum extends BaseControlledMetric<Long,ControlledMetricAccum.AccumValue>
ControlledMetric
for metrics like page-count or database-accesses that you are adding to continually
as opposed to a ControlledMetricValue
.Modifier and Type | Class and Description |
---|---|
static class |
ControlledMetricAccum.AccumValue
Wrapper around a long counter and a reset flag.
|
ControlledMetric.AggregationType
Constructor and Description |
---|
ControlledMetricAccum(String component,
String module,
String name,
String description,
String unit) |
Modifier and Type | Method and Description |
---|---|
long |
add(long delta)
Add a delta value to the metric.
|
void |
adjustValue(long value)
Adjust the value by a long primitive value.
|
void |
adjustValue(Number value)
Adjust the metric with this value.
|
ControlledMetricAccum.AccumValue |
createInitialValue()
Create the initial value for our metric.
|
ControlledMetric.AggregationType |
getAggregationType()
Returns the type of aggregation used by this metric.
|
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.
|
long |
increment()
Add one to the metric.
|
Long |
makeValueFromLong(long value)
Make a value type from long input.
|
Long |
makeValueFromNumber(Number value)
Make a value type from Number input.
|
compareTo, equals, getAggregationTypeName, getComponent, getDescription, getJmxBeanName, getJmxDomainName, getJmxFolderNames, getMetricValue, getModule, getName, getUnit, hashCode, storeValue, toString
public ControlledMetricAccum(String component, String module, String name, String description, String unit)
component
- Component short name such as "my". Required.module
- Module name to identify the part of the component such as "pageview". Null if none.name
- String label description the metric. Required.description
- Description for more information which may not be persisted.unit
- Unit of the metric. Null if none.public ControlledMetricAccum.AccumValue createInitialValue()
ControlledMetric
public Long makeValueFromLong(long value)
ControlledMetric
ControlledMetric.adjustValue(long)
method.public Long makeValueFromNumber(Number value)
ControlledMetric
ControlledMetric.adjustValue(Number)
method.public long add(long delta)
public long increment()
public void adjustValue(long value)
ControlledMetric
adjustValue
in interface ControlledMetric<Long,ControlledMetricAccum.AccumValue>
adjustValue
in class BaseControlledMetric<Long,ControlledMetricAccum.AccumValue>
public void adjustValue(Number value)
ControlledMetric
adjustValue
in interface ControlledMetric<Long,ControlledMetricAccum.AccumValue>
adjustValue
in class BaseControlledMetric<Long,ControlledMetricAccum.AccumValue>
public Number getValue()
BaseControlledMetric
BaseControlledMetric.getValueToPersist()
if you want to save the value to disk.getValue
in interface ControlledMetric<Long,ControlledMetricAccum.AccumValue>
getValue
in class BaseControlledMetric<Long,ControlledMetricAccum.AccumValue>
public MetricValueDetails getValueDetails()
BaseControlledMetric
BaseControlledMetric.getValueDetailsToPersist()
if you want to save the value to disk.getValueDetails
in interface ControlledMetric<Long,ControlledMetricAccum.AccumValue>
getValueDetails
in class BaseControlledMetric<Long,ControlledMetricAccum.AccumValue>
public Number getValueToPersist()
BaseControlledMetric
getValueToPersist
in interface ControlledMetric<Long,ControlledMetricAccum.AccumValue>
getValueToPersist
in class BaseControlledMetric<Long,ControlledMetricAccum.AccumValue>
public MetricValueDetails getValueDetailsToPersist()
BaseControlledMetric
getValueDetailsToPersist
in interface ControlledMetric<Long,ControlledMetricAccum.AccumValue>
getValueDetailsToPersist
in class BaseControlledMetric<Long,ControlledMetricAccum.AccumValue>
public ControlledMetric.AggregationType getAggregationType()
ControlledMetric
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.