Class MetricValue
java.lang.Object
com.azure.resourcemanager.monitor.models.MetricValue
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MetricValue>
public final class MetricValue
extends Object
implements com.azure.json.JsonSerializable<MetricValue>
Represents a metric value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaverage()
Get the average property: the average value in the time range.count()
Get the count property: the number of samples in the time range.static MetricValue
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MetricValue from the JsonReader.maximum()
Get the maximum property: the greatest value in the time range.minimum()
Get the minimum property: the least value in the time range.Get the timestamp property: the timestamp for the metric value in ISO 8601 format.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) total()
Get the total property: the sum of all of the values in the time range.void
validate()
Validates the instance.withAverage
(Double average) Set the average property: the average value in the time range.Set the count property: the number of samples in the time range.withMaximum
(Double maximum) Set the maximum property: the greatest value in the time range.withMinimum
(Double minimum) Set the minimum property: the least value in the time range.withTimestamp
(OffsetDateTime timestamp) Set the timestamp property: the timestamp for the metric value in ISO 8601 format.Set the total property: the sum of all of the values in the time range.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
MetricValue
public MetricValue()Creates an instance of MetricValue class.
-
-
Method Details
-
timestamp
Get the timestamp property: the timestamp for the metric value in ISO 8601 format.- Returns:
- the timestamp value.
-
withTimestamp
Set the timestamp property: the timestamp for the metric value in ISO 8601 format.- Parameters:
timestamp
- the timestamp value to set.- Returns:
- the MetricValue object itself.
-
average
Get the average property: the average value in the time range.- Returns:
- the average value.
-
withAverage
Set the average property: the average value in the time range.- Parameters:
average
- the average value to set.- Returns:
- the MetricValue object itself.
-
minimum
Get the minimum property: the least value in the time range.- Returns:
- the minimum value.
-
withMinimum
Set the minimum property: the least value in the time range.- Parameters:
minimum
- the minimum value to set.- Returns:
- the MetricValue object itself.
-
maximum
Get the maximum property: the greatest value in the time range.- Returns:
- the maximum value.
-
withMaximum
Set the maximum property: the greatest value in the time range.- Parameters:
maximum
- the maximum value to set.- Returns:
- the MetricValue object itself.
-
total
Get the total property: the sum of all of the values in the time range.- Returns:
- the total value.
-
withTotal
Set the total property: the sum of all of the values in the time range.- Parameters:
total
- the total value to set.- Returns:
- the MetricValue object itself.
-
count
Get the count property: the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.- Returns:
- the count value.
-
withCount
Set the count property: the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.- Parameters:
count
- the count value to set.- Returns:
- the MetricValue object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<MetricValue>
- Throws:
IOException
-
fromJson
Reads an instance of MetricValue from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of MetricValue if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the MetricValue.
-