Package ai.djl.metric

Class Metric


  • public class Metric
    extends java.lang.Object
    A class representing a single recorded Metric value.
    See Also:
    Metrics
    • Constructor Summary

      Constructors 
      Constructor Description
      Metric​(java.lang.String metricName, java.lang.Number value)
      Constructs a Metric instance with the specified metricName and value.
      Metric​(java.lang.String metricName, java.lang.Number value, java.lang.String unit)
      Constructs a Metric instance with the specified metricName, value , and unit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMetricName()
      Returns the name of the Metric.
      long getTimestamp()
      Returns the timestamp of the Metric.
      java.lang.String getUnit()
      Returns the unit of the Metric.
      java.lang.Number getValue()
      Returns the value of the Metric.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Metric

        public Metric​(java.lang.String metricName,
                      java.lang.Number value)
        Constructs a Metric instance with the specified metricName and value.
        Parameters:
        metricName - the metric name
        value - the metric value
      • Metric

        public Metric​(java.lang.String metricName,
                      java.lang.Number value,
                      java.lang.String unit)
        Constructs a Metric instance with the specified metricName, value , and unit.
        Parameters:
        metricName - the metric name
        value - the metric value
        unit - the metric unit
    • Method Detail

      • getMetricName

        public java.lang.String getMetricName()
        Returns the name of the Metric.
        Returns:
        the metric name
      • getValue

        public java.lang.Number getValue()
        Returns the value of the Metric.
        Returns:
        the metric value
      • getUnit

        public java.lang.String getUnit()
        Returns the unit of the Metric.
        Returns:
        the metric unit
      • getTimestamp

        public long getTimestamp()
        Returns the timestamp of the Metric.
        Returns:
        the metric timestamp
      • toString

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