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, Unit unit)
      Constructs a Metric instance with the specified metricName, value , and unit.
      Metric​(java.lang.String metricName, java.lang.Number value, Unit unit, Dimension... dimensions)
      Constructs a Metric instance with the specified metricName, value , and unit.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Dimension[] getDimensions()
      Returns the metric dimensions.
      java.lang.String getMetricName()
      Returns the name of the Metric.
      java.lang.String getTimestamp()
      Returns the timestamp of the Metric.
      Unit getUnit()
      Returns the unit of the Metric.
      java.lang.Double getValue()
      Returns the int value of the Metric.
      static Metric parse​(java.lang.String line)
      Returns a Metric instance parsed from the log string.
      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,
                      Unit 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
      • Metric

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

      • getMetricName

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

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

        public Unit getUnit()
        Returns the unit of the Metric.
        Returns:
        the metric unit
      • getTimestamp

        public java.lang.String getTimestamp()
        Returns the timestamp of the Metric.
        Returns:
        the metric timestamp
      • getDimensions

        public Dimension[] getDimensions()
        Returns the metric dimensions.
        Returns:
        the metric dimensions
      • parse

        public static Metric parse​(java.lang.String line)
        Returns a Metric instance parsed from the log string.
        Parameters:
        line - the input string
        Returns:
        a Metric object
      • toString

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