Package ai.djl.metric
Class Metric
- java.lang.Object
-
- ai.djl.metric.Metric
-
public class Metric extends java.lang.ObjectA class representing a single recordedMetricvalue.- See Also:
Metrics
-
-
Constructor Summary
Constructors Constructor Description Metric(java.lang.String metricName, java.lang.Number value)Constructs aMetricinstance with the specifiedmetricNameandvalue.Metric(java.lang.String metricName, java.lang.Number value, java.lang.String unit)Constructs aMetricinstance with the specifiedmetricName,value, andunit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetMetricName()Returns the name of theMetric.longgetTimestamp()Returns the timestamp of theMetric.java.lang.StringgetUnit()Returns the unit of theMetric.java.lang.NumbergetValue()Returns the value of theMetric.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Metric
public Metric(java.lang.String metricName, java.lang.Number value)Constructs aMetricinstance with the specifiedmetricNameandvalue.- Parameters:
metricName- the metric namevalue- the metric value
-
Metric
public Metric(java.lang.String metricName, java.lang.Number value, java.lang.String unit)Constructs aMetricinstance with the specifiedmetricName,value, andunit.- Parameters:
metricName- the metric namevalue- the metric valueunit- the metric unit
-
-
Method Detail
-
getMetricName
public java.lang.String getMetricName()
Returns the name of theMetric.- Returns:
- the metric name
-
getValue
public java.lang.Number getValue()
Returns the value of theMetric.- Returns:
- the metric value
-
getUnit
public java.lang.String getUnit()
Returns the unit of theMetric.- Returns:
- the metric unit
-
getTimestamp
public long getTimestamp()
Returns the timestamp of theMetric.- Returns:
- the metric timestamp
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-