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
ConstructorDescriptionConstructs aMetric
instance with the specifiedmetricName
andvalue
.Constructs aMetric
instance with the specifiedmetricName
,value
, andunit
.Constructs aMetric
instance with the specifiedmetricName
,value
, andunit
. -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of the metric with a new name.Returns 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 Metric
Returns aMetric
instance parsed from the log string.toString()
-
Constructor Details
-
Metric
Constructs aMetric
instance with the specifiedmetricName
andvalue
.- Parameters:
metricName
- the metric namevalue
- the metric value
-
Metric
Constructs aMetric
instance with the specifiedmetricName
,value
, andunit
.- Parameters:
metricName
- the metric namevalue
- the metric valueunit
- the metric unit
-
Metric
Constructs aMetric
instance with the specifiedmetricName
,value
, andunit
.- Parameters:
metricName
- the metric namevalue
- the metric valueunit
- the metric unitdimensions
- the metric dimensions
-
-
Method Details
-
copyOf
Returns a copy of the metric with a new name.- Parameters:
name
- the new metric name- Returns:
- a copy of the metric
-
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 aMetric
instance parsed from the log string.- Parameters:
line
- the input string- Returns:
- a
Metric
object
-
toString
-