Class Count

  • All Implemented Interfaces:
    Metric, Telemetry

    public final class Count
    extends java.lang.Object
    implements Metric
    A Metric that represents a single signed, floating-point quantity measured over a period of time.

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

    • Constructor Summary

      Constructors 
      Constructor Description
      Count​(java.lang.String name, double value, long startTimeMs, long endTimeMs, Attributes attributes)
      Create a new Count instance.
    • Constructor Detail

      • Count

        public Count​(java.lang.String name,
                     double value,
                     long startTimeMs,
                     long endTimeMs,
                     Attributes attributes)
        Create a new Count instance.
        Parameters:
        name - The name of this count instance.
        value - The value for this count instance.
        startTimeMs - The start time of the interval over which the count was measured. This is in milliseconds since epoch.
        endTimeMs - The end time of the interval over which the count was measured. This is in milliseconds since epoch.
        attributes - Any additional attributes associated with this count.
    • Method Detail

      • getName

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

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

        public double getValue()
        Returns:
        The value, which should be a positive number, representing the Count for the provided interval.
      • getStartTimeMs

        public long getStartTimeMs()
        Returns:
        The start time of the interval over which this Count was recorded, in milliseconds since epoch.
      • getEndTimeMs

        public long getEndTimeMs()
        Returns:
        The end time of the interval over which this Count was recorded, in milliseconds since epoch.
      • 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