java.lang.Object
org.springframework.boot.actuate.autoconfigure.metrics.MeterValue

public final class MeterValue extends Object
A meter value that is used when configuring micrometer. Can be a String representation of either a Double (applicable to timers and distribution summaries) or a Duration (applicable to only timers).
Since:
2.2.0
Author:
Phillip Webb, Stephane Nicoll
  • Method Details

    • getValue

      public Double getValue(io.micrometer.core.instrument.Meter.Type meterType)
      Return the underlying value in form suitable to apply to the given meter type.
      Parameters:
      meterType - the meter type
      Returns:
      the value or null if the value cannot be applied
    • valueOf

      public static MeterValue valueOf(String value)
      Return a new MeterValue instance for the given String value. The value may contain a simple number, or a duration style string.
      Parameters:
      value - the source value
      Returns:
      a MeterValue instance
    • valueOf

      public static MeterValue valueOf(double value)
      Return a new MeterValue instance for the given double value.
      Parameters:
      value - the source value
      Returns:
      a MeterValue instance
      Since:
      2.3.0