public interface ValueMetric extends Metric
Used when events have a value such as bytes sent, bytes received, lines read etc.
// Declare the metric (typically as a static field)
static final ValueMetric totalBytesSentMetric = MetricManager.getValueMetric(MyService.class, "totalBytesSent");
...
public void performSomeIO() {
long bytesSent = ...
totalBytesSentMetric.addEvent(bytesSent);
...
}
Modifier and Type | Method and Description |
---|---|
void |
addEvent(long value)
Add a value (bytes, time, rows etc).
|
ValueStatistics |
getCollectedStatistics()
Return the statistics collected.
|
clearStatistics, collectStatistics, getName, visit
ValueStatistics getCollectedStatistics()
void addEvent(long value)
Copyright © 2014. All Rights Reserved.