다음을 통해 공유


MetricCriteria Class

public final class MetricCriteria
extends MultiMetricCriteria

Criterion to filter metrics.

Constructor Summary

Constructor Description
MetricCriteria()

Creates an instance of MetricCriteria class.

Method Summary

Modifier and Type Method and Description
CriterionType criterionType()

Get the criterionType property: Specifies the type of threshold criteria.

static MetricCriteria fromJson(JsonReader jsonReader)

Reads an instance of MetricCriteria from the JsonReader.

Operator operator()

Get the operator property: the criteria operator.

double threshold()

Get the threshold property: the criteria threshold value that activates the alert.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

MetricCriteria withDimensions(List<MetricDimension> dimensions)

Set the dimensions property: List of dimension conditions.

MetricCriteria withMetricName(String metricName)

Set the metricName property: Name of the metric.

MetricCriteria withMetricNamespace(String metricNamespace)

Set the metricNamespace property: Namespace of the metric.

MetricCriteria withName(String name)

Set the name property: Name of the criteria.

MetricCriteria withOperator(Operator operator)

Set the operator property: the criteria operator.

MetricCriteria withSkipMetricValidation(Boolean skipMetricValidation)

Set the skipMetricValidation property: Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.

MetricCriteria withThreshold(double threshold)

Set the threshold property: the criteria threshold value that activates the alert.

MetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation)

Set the timeAggregation property: the criteria time aggregation types.

Methods inherited from MultiMetricCriteria

Methods inherited from java.lang.Object

Constructor Details

MetricCriteria

public MetricCriteria()

Creates an instance of MetricCriteria class.

Method Details

criterionType

public CriterionType criterionType()

Get the criterionType property: Specifies the type of threshold criteria.

Overrides:

MetricCriteria.criterionType()

Returns:

the criterionType value.

fromJson

public static MetricCriteria fromJson(JsonReader jsonReader)

Reads an instance of MetricCriteria from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MetricCriteria if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

operator

public Operator operator()

Get the operator property: the criteria operator.

Returns:

the operator value.

threshold

public double threshold()

Get the threshold property: the criteria threshold value that activates the alert.

Returns:

the threshold value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

MetricCriteria.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

Overrides:

MetricCriteria.validate()

withDimensions

public MetricCriteria withDimensions(List dimensions)

Set the dimensions property: List of dimension conditions.

Overrides:

MetricCriteria.withDimensions(List<MetricDimension> dimensions)

Parameters:

dimensions

withMetricName

public MetricCriteria withMetricName(String metricName)

Set the metricName property: Name of the metric.

Overrides:

MetricCriteria.withMetricName(String metricName)

Parameters:

metricName

withMetricNamespace

public MetricCriteria withMetricNamespace(String metricNamespace)

Set the metricNamespace property: Namespace of the metric.

Overrides:

MetricCriteria.withMetricNamespace(String metricNamespace)

Parameters:

metricNamespace

withName

public MetricCriteria withName(String name)

Set the name property: Name of the criteria.

Overrides:

MetricCriteria.withName(String name)

Parameters:

name

withOperator

public MetricCriteria withOperator(Operator operator)

Set the operator property: the criteria operator.

Parameters:

operator - the operator value to set.

Returns:

the MetricCriteria object itself.

withSkipMetricValidation

public MetricCriteria withSkipMetricValidation(Boolean skipMetricValidation)

Set the skipMetricValidation property: Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.

Overrides:

MetricCriteria.withSkipMetricValidation(Boolean skipMetricValidation)

Parameters:

skipMetricValidation

withThreshold

public MetricCriteria withThreshold(double threshold)

Set the threshold property: the criteria threshold value that activates the alert.

Parameters:

threshold - the threshold value to set.

Returns:

the MetricCriteria object itself.

withTimeAggregation

public MetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation)

Set the timeAggregation property: the criteria time aggregation types.

Overrides:

MetricCriteria.withTimeAggregation(AggregationTypeEnum timeAggregation)

Parameters:

timeAggregation

Applies to