Class MetricsQueryResult

java.lang.Object
com.azure.monitor.query.models.MetricsQueryResult

public final class MetricsQueryResult extends Object
The response to a metrics query.
  • Constructor Details

    • MetricsQueryResult

      public MetricsQueryResult(Integer cost, QueryTimeInterval timeInterval, Duration granularity, String namespace, String resourceRegion, List<MetricResult> metrics)
      Creates an instance of the response to a metrics query.
      Parameters:
      cost - the integer value representing the cost of the query, for data case.
      timeInterval - the time interval for which the data was retrieved.
      granularity - the interval (window size) for which the metric data was returned in.
      namespace - the namespace of the metrics been queried.
      resourceRegion - the region of the resource been queried for metrics.
      metrics - the value of the collection.
  • Method Details

    • getCost

      public Integer getCost()
      Returns the integer value representing the cost of the query, for data case.
      Returns:
      the integer value representing the cost of the query, for data case.
    • getTimeInterval

      public QueryTimeInterval getTimeInterval()
      Returns the time interval for which the data was retrieved.
      Returns:
      the time interval for which the data was retrieved.
    • getGranularity

      public Duration getGranularity()
      Returns the interval (window size) for which the metric data was returned in.
      Returns:
      the interval (window size) for which the metric data was returned in.
    • getNamespace

      public String getNamespace()
      Returns the namespace of the metrics been queried
      Returns:
      the namespace of the metrics been queried
    • getResourceRegion

      public String getResourceRegion()
      Returns the region of the resource been queried for metrics.
      Returns:
      the region of the resource been queried for metrics.
    • getMetrics

      public List<MetricResult> getMetrics()
      Returns the value of the collection.
      Returns:
      the value of the collection.
    • getMetricByName

      public MetricResult getMetricByName(String metricName)
      Returns the metric result for the metricName.
      Parameters:
      metricName - The name of the metric to look up the result for.
      Returns:
      The MetricResult for metricName if found, null otherwise.