public class ControlledMetricTimer extends ControlledMetricValue
ControlledMetricTimer timer = new ControlledMetricTimer(...); ... long millis = timer.start(); dao.createEntry(...); timer.end(millis);The rest is done by the class and the metric system.
ControlledMetricValue.ValueCount
ControlledMetric.AggregationType
Constructor and Description |
---|
ControlledMetricTimer(String component,
String module,
String name,
String description) |
Modifier and Type | Method and Description |
---|---|
long |
start()
Start the timer on a particular event.
|
long |
stop(long startMillis)
End the timer on a particular event.
|
createInitialValue, getAggregationType, makeValueFromLong, makeValueFromNumber
adjustValue, adjustValue, compareTo, equals, getAggregationTypeName, getComponent, getDescription, getJmxBeanName, getJmxDomainName, getJmxFolderNames, getMetricValue, getModule, getName, getUnit, getValue, getValueDetails, getValueDetailsToPersist, getValueToPersist, hashCode, storeValue, toString
public ControlledMetricTimer(String component, String module, String name, String description)
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.public long start()
stop(long)
as the argument.public long stop(long startMillis)
startMillis
- Value returned from a previous call to start()
.This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.