All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.heroku.agent.metrics.Metric Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.0.3
Show newest version
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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy