Class Gauge

  • All Implemented Interfaces:
    Metric, Telemetry

    public final class Gauge
    extends java.lang.Object
    implements Metric
    A Metric representing a single signed, floating-point quantity measured at a point in time.

    Important: Values are not validated on construction, and this class's methods do not throw.

    • Constructor Summary

      Constructors 
      Constructor Description
      Gauge​(java.lang.String name, double value, long timestamp, Attributes attributes)  
    • Constructor Detail

      • Gauge

        public Gauge​(java.lang.String name,
                     double value,
                     long timestamp,
                     Attributes attributes)
        Parameters:
        name - The name for this Gauge metric.
        value - The value of this Gauge, recorded at the point in time.
        timestamp - The point in time this Gauge measurement was recorded, in milliseconds since epoch.
        attributes - Dimensional attributes, as key-value pairs, associated with this Gauge.
    • Method Detail

      • getValue

        public double getValue()
        Returns:
        The value of this Gauge, recorded at the point in time.
      • getTimestamp

        public long getTimestamp()
        Returns:
        The point in time this Gauge measurement was recorded, in milliseconds since epoch.
      • getName

        public java.lang.String getName()
        Returns:
        The name for this Gauge metric.
      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Returns:
        Dimensional attributes, as key-value pairs, associated with this Gauge.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object