Share via


MetricsQueryOptions Class

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

public final class MetricsQueryOptions

The model class to configure the metrics query options.

Constructor Summary

Constructor Description
MetricsQueryOptions()

Method Summary

Modifier and Type Method and Description
List<AggregationType> getAggregations()

Returns the list of aggregations that should be applied to the metrics data.

String getFilter()

Returns the filter to be applied to the query.

Duration getGranularity()

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

String getMetricNamespace()

Returns the namespace of the metrics been queried

String getOrderBy()

Returns the order in which the query results should be ordered.

QueryTimeInterval getTimeInterval()

Returns the time span for which the metrics data is queried.

Integer getTop()

Returns the number of top metrics values to query.

MetricsQueryOptions setAggregations(AggregationType[] aggregations)

Sets the list of aggregations that should be applied to the metrics data.

MetricsQueryOptions setAggregations(List<AggregationType> aggregations)

Sets the list of aggregations that should be applied to the metrics data.

MetricsQueryOptions setFilter(String filter)

Sets the filter to be applied to the query.

MetricsQueryOptions setGranularity(Duration granularity)

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

MetricsQueryOptions setMetricNamespace(String metricNamespace)

Sets the namespace of the metrics been queried

MetricsQueryOptions setOrderBy(String orderBy)

Sets the order in which the query results should be ordered.

MetricsQueryOptions setTimeInterval(QueryTimeInterval timeInterval)

Sets the time span for which the metrics data is queried.

MetricsQueryOptions setTop(Integer top)

Sets the number of top metrics values to query.

Methods inherited from java.lang.Object

Constructor Details

MetricsQueryOptions

public MetricsQueryOptions()

Method Details

getAggregations

public List<AggregationType> getAggregations()

Returns the list of aggregations that should be applied to the metrics data.

Returns:

the list of aggregations that should be applied to the metrics data.

getFilter

public String getFilter()

Returns the filter to be applied to the query. The filter users OData format.

Returns:

the filter to be applied to the query. The filter users OData format.

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.

getMetricNamespace

public String getMetricNamespace()

Returns the namespace of the metrics been queried

Returns:

the namespace of the metrics been queried

getOrderBy

public String getOrderBy()

Returns the order in which the query results should be ordered.

Returns:

the order in which the query results should be ordered.

getTimeInterval

public QueryTimeInterval getTimeInterval()

Returns the time span for which the metrics data is queried.

Returns:

the time span for which the metrics data is queried.

getTop

public Integer getTop()

Returns the number of top metrics values to query.

Returns:

the number of top metrics values to query.

setAggregations

public MetricsQueryOptions setAggregations(AggregationType[] aggregations)

Sets the list of aggregations that should be applied to the metrics data.

Parameters:

aggregations - the list of aggregations that should be applied to the metrics data.

Returns:

The updated options instance

setAggregations

public MetricsQueryOptions setAggregations(List<AggregationType> aggregations)

Sets the list of aggregations that should be applied to the metrics data.

Parameters:

aggregations - the list of aggregations that should be applied to the metrics data.

Returns:

The updated options instance

setFilter

public MetricsQueryOptions setFilter(String filter)

Sets the filter to be applied to the query. The filter users OData format.

Parameters:

filter - the filter to be applied to the query. The filter users OData format.

Returns:

The updated options instance

setGranularity

public MetricsQueryOptions setGranularity(Duration granularity)

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

Parameters:

granularity - The interval (window size) for which the metric data was returned in.

Returns:

The updated options instance

setMetricNamespace

public MetricsQueryOptions setMetricNamespace(String metricNamespace)

Sets the namespace of the metrics been queried

Parameters:

metricNamespace - the namespace of the metrics been queried

Returns:

The updated options instance

setOrderBy

public MetricsQueryOptions setOrderBy(String orderBy)

Sets the order in which the query results should be ordered.

Parameters:

orderBy - the order in which the query results should be ordered.

Returns:

The updated options instance

setTimeInterval

public MetricsQueryOptions setTimeInterval(QueryTimeInterval timeInterval)

Sets the time span for which the metrics data is queried.

Parameters:

timeInterval - the time span for which the metrics data is queried.

Returns:

The updated options instance

setTop

public MetricsQueryOptions setTop(Integer top)

Sets the number of top metrics values to query.

Parameters:

top - the number of top metrics values to query.

Returns:

The updated options instance

Applies to