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).
|
long |
getCount()
Return the count of values collected (since the last reset/collection).
|
long |
getMax()
Return the Max value collected (since the last reset/collection).
|
long |
getMean()
Return the mean value rounded up for the values collected since the last reset/collection.
|
long |
getTotal()
Return the total of all the values (since the last reset/collection).
|
void addEvent(long value)
long getCount()
long getTotal()
long getMax()
long getMean()
Copyright © 2019. All rights reserved.