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, Unit unit)Constructs aMetricinstance with the specifiedmetricName,value, andunit.Metric(java.lang.String metricName, java.lang.Number value, Unit unit, Dimension... dimensions)Constructs aMetricinstance with the specifiedmetricName,value, andunit.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Dimension[]getDimensions()Returns the metric dimensions.java.lang.StringgetMetricName()Returns the name of theMetric.java.lang.StringgetTimestamp()Returns the timestamp of theMetric.UnitgetUnit()Returns the unit of theMetric.java.lang.DoublegetValue()Returns the int value of theMetric.static Metricparse(java.lang.String line)Returns aMetricinstance parsed from the log string.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, Unit unit)Constructs aMetricinstance with the specifiedmetricName,value, andunit.- Parameters:
metricName- the metric namevalue- the metric valueunit- the metric unit
-
Metric
public Metric(java.lang.String metricName, java.lang.Number value, Unit unit, Dimension... dimensions)Constructs aMetricinstance with the specifiedmetricName,value, andunit.- Parameters:
metricName- the metric namevalue- the metric valueunit- the metric unitdimensions- the metric dimensions
-
-
Method Detail
-
getMetricName
public java.lang.String getMetricName()
Returns the name of theMetric.- Returns:
- the metric name
-
getValue
public java.lang.Double getValue()
Returns the int value of theMetric.- Returns:
- the metric value in int
-
getUnit
public Unit getUnit()
Returns the unit of theMetric.- Returns:
- the metric unit
-
getTimestamp
public java.lang.String getTimestamp()
Returns the timestamp of theMetric.- 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 aMetricinstance parsed from the log string.- Parameters:
line- the input string- Returns:
- a
Metricobject
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-