Class MetricValue

java.lang.Object
com.azure.resourcemanager.cosmos.models.MetricValue
All Implemented Interfaces:
com.azure.json.JsonSerializable<MetricValue>
Direct Known Subclasses:
PercentileMetricValue

public class MetricValue extends Object implements com.azure.json.JsonSerializable<MetricValue>
Represents metrics values.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of MetricValue class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the average property: The average value of the metric.
    Get the count property: The number of values for the metric.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of MetricValue from the JsonReader.
    Get the maximum property: The max value of the metric.
    Get the minimum property: The min value of the metric.
    Get the timestamp property: The metric timestamp (ISO-8601 format).
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    Get the total property: The total value of the metric.
    void
    Validates the instance.

    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

    • count

      public Integer count()
      Get the count property: The number of values for the metric.
      Returns:
      the count value.
    • average

      public Double average()
      Get the average property: The average value of the metric.
      Returns:
      the average value.
    • maximum

      public Double maximum()
      Get the maximum property: The max value of the metric.
      Returns:
      the maximum value.
    • minimum

      public Double minimum()
      Get the minimum property: The min value of the metric.
      Returns:
      the minimum value.
    • timestamp

      public OffsetDateTime timestamp()
      Get the timestamp property: The metric timestamp (ISO-8601 format).
      Returns:
      the timestamp value.
    • total

      public Double total()
      Get the total property: The total value of the metric.
      Returns:
      the total value.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<MetricValue>
      Throws:
      IOException
    • fromJson

      public static MetricValue fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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:
      IOException - If an error occurs while reading the MetricValue.