com.heroku.agent.metrics.Metric Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of heroku-java-metrics-agent Show documentation
Show all versions of heroku-java-metrics-agent Show documentation
This artifact is for use with the JVM Runtime Metrics features.
It is a lightweight Java agent that uses a Prometheus Java client to report metrics.
package com.heroku.agent.metrics;
public class Metric {
private String key;
private Double value;
public Metric(String key, Double value) {
this.key = key;
this.value = value;
}
public Double getValue() {
return value;
}
public Double getDerivedValue(Metric previousMetric) {
return previousMetric == null || this.value < previousMetric.getValue() ?
this.value :
this.value - previousMetric.getValue();
}
public String getKey() {
return key;
}
}