Package ai.djl.metric
Class Metric
java.lang.Object
ai.djl.metric.Metric
A class representing a single recorded
Metric value.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aMetricinstance with the specifiedmetricNameandvalue.Constructs aMetricinstance with the specifiedmetricName,value, andunit.Constructs aMetricinstance with the specifiedmetricName,value, andunit. -
Method Summary
Modifier and TypeMethodDescriptionReturns the metric dimensions.Returns the name of theMetric.Returns the timestamp of theMetric.getUnit()Returns the unit of theMetric.getValue()Returns the int value of theMetric.static MetricReturns aMetricinstance parsed from the log string.toString()
-
Constructor Details
-
Metric
Constructs aMetricinstance with the specifiedmetricNameandvalue.- Parameters:
metricName- the metric namevalue- the metric value
-
Metric
Constructs aMetricinstance with the specifiedmetricName,value, andunit.- Parameters:
metricName- the metric namevalue- the metric valueunit- the metric unit
-
Metric
Constructs aMetricinstance with the specifiedmetricName,value, andunit.- Parameters:
metricName- the metric namevalue- the metric valueunit- the metric unitdimensions- the metric dimensions
-
-
Method Details
-
getMetricName
Returns the name of theMetric.- Returns:
- the metric name
-
getValue
Returns the int value of theMetric.- Returns:
- the metric value in int
-
getUnit
Returns the unit of theMetric.- Returns:
- the metric unit
-
getTimestamp
Returns the timestamp of theMetric.- Returns:
- the metric timestamp
-
getDimensions
Returns the metric dimensions.- Returns:
- the metric dimensions
-
parse
Returns aMetricinstance parsed from the log string.- Parameters:
line- the input string- Returns:
- a
Metricobject
-
toString
-