![JAR search and dependency download from the Maven repository](/logo.png)
org.avaje.metric.ValueMetric Maven / Gradle / Ivy
The newest version!
package org.avaje.metric;
/**
* Metric that collects long values (e.g. total bytes sent).
*
* 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);
* ...
* }
*
*
*
*/
public interface ValueMetric extends Metric {
/**
* Return the statistics collected.
*/
ValueStatistics getCollectedStatistics();
/**
* Add a value (bytes, time, rows etc).
*/
void addEvent(long value);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy