MetricsQueryResult Class

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

public final class MetricsQueryResult

The response to a metrics query.

Constructor Summary

Constructor Description
MetricsQueryResult(Integer cost, QueryTimeInterval timeInterval, Duration granularity, String namespace, String resourceRegion, List<MetricResult> metrics)

Creates an instance of the response to a metrics query.

Method Summary

Modifier and Type Method and Description
Integer getCost()

Returns the integer value representing the cost of the query, for data case.

Duration getGranularity()

Returns the interval (window size) for which the metric data was returned in.

MetricResult getMetricByName(String metricName)

Returns the metric result for the metricName.

List<MetricResult> getMetrics()

Returns the value of the collection.

String getNamespace()

Returns the namespace of the metrics been queried

String getResourceId()

Returns the resource id of the resource this metrics result belongs to.

String getResourceRegion()

Returns the region of the resource been queried for metrics.

QueryTimeInterval getTimeInterval()

Returns the time interval for which the data was retrieved.

Methods inherited from java.lang.Object

Constructor Details

MetricsQueryResult

public MetricsQueryResult(Integer cost, QueryTimeInterval timeInterval, Duration granularity, String namespace, String resourceRegion, List 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.

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.

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.

getMetrics

public List getMetrics()

Returns the value of the collection.

Returns:

the value of the collection.

getNamespace

public String getNamespace()

Returns the namespace of the metrics been queried

Returns:

the namespace of the metrics been queried

getResourceId

public String getResourceId()

Returns the resource id of the resource this metrics result belongs to.

Returns:

the resource id of the resource this metrics result belongs to.

getResourceRegion

public String getResourceRegion()

Returns the region of the resource been queried for metrics.

Returns:

the region of the resource been queried for metrics.

getTimeInterval

public QueryTimeInterval getTimeInterval()

Returns the time interval for which the data was retrieved.

Returns:

the time interval for which the data was retrieved.

Applies to