MetricTrigger Class

  • java.lang.Object
    • com.azure.resourcemanager.monitor.models.MetricTrigger

Implements

public final class MetricTrigger
implements JsonSerializable<MetricTrigger>

The trigger that results in a scaling action.

Constructor Summary

Constructor Description
MetricTrigger()

Creates an instance of MetricTrigger class.

Method Summary

Modifier and Type Method and Description
List<ScaleRuleMetricDimension> dimensions()

Get the dimensions property: List of dimension conditions.

Boolean dividePerInstance()

Get the dividePerInstance property: a value indicating whether metric should divide per instance.

static MetricTrigger fromJson(JsonReader jsonReader)

Reads an instance of MetricTrigger from the JsonReader.

String metricName()

Get the metricName property: the name of the metric that defines what the rule monitors.

String metricNamespace()

Get the metricNamespace property: the namespace of the metric that defines what the rule monitors.

String metricResourceLocation()

Get the metricResourceLocation property: the location of the resource the rule monitors.

String metricResourceUri()

Get the metricResourceUri property: the resource identifier of the resource the rule monitors.

ComparisonOperationType operator()

Get the operator property: the operator that is used to compare the metric data and the threshold.

MetricStatisticType statistic()

Get the statistic property: the metric statistic type.

double threshold()

Get the threshold property: the threshold of the metric that triggers the scale action.

TimeAggregationType timeAggregation()

Get the timeAggregation property: time aggregation type.

Duration timeGrain()

Get the timeGrain property: the granularity of metrics the rule monitors.

Duration timeWindow()

Get the timeWindow property: the range of time in which instance data is collected.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

MetricTrigger withDimensions(List<ScaleRuleMetricDimension> dimensions)

Set the dimensions property: List of dimension conditions.

MetricTrigger withDividePerInstance(Boolean dividePerInstance)

Set the dividePerInstance property: a value indicating whether metric should divide per instance.

MetricTrigger withMetricName(String metricName)

Set the metricName property: the name of the metric that defines what the rule monitors.

MetricTrigger withMetricNamespace(String metricNamespace)

Set the metricNamespace property: the namespace of the metric that defines what the rule monitors.

MetricTrigger withMetricResourceLocation(String metricResourceLocation)

Set the metricResourceLocation property: the location of the resource the rule monitors.

MetricTrigger withMetricResourceUri(String metricResourceUri)

Set the metricResourceUri property: the resource identifier of the resource the rule monitors.

MetricTrigger withOperator(ComparisonOperationType operator)

Set the operator property: the operator that is used to compare the metric data and the threshold.

MetricTrigger withStatistic(MetricStatisticType statistic)

Set the statistic property: the metric statistic type.

MetricTrigger withThreshold(double threshold)

Set the threshold property: the threshold of the metric that triggers the scale action.

MetricTrigger withTimeAggregation(TimeAggregationType timeAggregation)

Set the timeAggregation property: time aggregation type.

MetricTrigger withTimeGrain(Duration timeGrain)

Set the timeGrain property: the granularity of metrics the rule monitors.

MetricTrigger withTimeWindow(Duration timeWindow)

Set the timeWindow property: the range of time in which instance data is collected.

Methods inherited from java.lang.Object

Constructor Details

MetricTrigger

public MetricTrigger()

Creates an instance of MetricTrigger class.

Method Details

dimensions

public List dimensions()

Get the dimensions property: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].

Returns:

the dimensions value.

dividePerInstance

public Boolean dividePerInstance()

Get the dividePerInstance property: a value indicating whether metric should divide per instance.

Returns:

the dividePerInstance value.

fromJson

public static MetricTrigger fromJson(JsonReader jsonReader)

Reads an instance of MetricTrigger from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MetricTrigger 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.

metricName

public String metricName()

Get the metricName property: the name of the metric that defines what the rule monitors.

Returns:

the metricName value.

metricNamespace

public String metricNamespace()

Get the metricNamespace property: the namespace of the metric that defines what the rule monitors.

Returns:

the metricNamespace value.

metricResourceLocation

public String metricResourceLocation()

Get the metricResourceLocation property: the location of the resource the rule monitors.

Returns:

the metricResourceLocation value.

metricResourceUri

public String metricResourceUri()

Get the metricResourceUri property: the resource identifier of the resource the rule monitors.

Returns:

the metricResourceUri value.

operator

public ComparisonOperationType operator()

Get the operator property: the operator that is used to compare the metric data and the threshold.

Returns:

the operator value.

statistic

public MetricStatisticType statistic()

Get the statistic property: the metric statistic type. How the metrics from multiple instances are combined.

Returns:

the statistic value.

threshold

public double threshold()

Get the threshold property: the threshold of the metric that triggers the scale action.

Returns:

the threshold value.

timeAggregation

public TimeAggregationType timeAggregation()

Get the timeAggregation property: time aggregation type. How the data that is collected should be combined over time. The default value is Average.

Returns:

the timeAggregation value.

timeGrain

public Duration timeGrain()

Get the timeGrain property: the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.

Returns:

the timeGrain value.

timeWindow

public Duration timeWindow()

Get the timeWindow property: the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.

Returns:

the timeWindow value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withDimensions

public MetricTrigger withDimensions(List dimensions)

Set the dimensions property: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].

Parameters:

dimensions - the dimensions value to set.

Returns:

the MetricTrigger object itself.

withDividePerInstance

public MetricTrigger withDividePerInstance(Boolean dividePerInstance)

Set the dividePerInstance property: a value indicating whether metric should divide per instance.

Parameters:

dividePerInstance - the dividePerInstance value to set.

Returns:

the MetricTrigger object itself.

withMetricName

public MetricTrigger withMetricName(String metricName)

Set the metricName property: the name of the metric that defines what the rule monitors.

Parameters:

metricName - the metricName value to set.

Returns:

the MetricTrigger object itself.

withMetricNamespace

public MetricTrigger withMetricNamespace(String metricNamespace)

Set the metricNamespace property: the namespace of the metric that defines what the rule monitors.

Parameters:

metricNamespace - the metricNamespace value to set.

Returns:

the MetricTrigger object itself.

withMetricResourceLocation

public MetricTrigger withMetricResourceLocation(String metricResourceLocation)

Set the metricResourceLocation property: the location of the resource the rule monitors.

Parameters:

metricResourceLocation - the metricResourceLocation value to set.

Returns:

the MetricTrigger object itself.

withMetricResourceUri

public MetricTrigger withMetricResourceUri(String metricResourceUri)

Set the metricResourceUri property: the resource identifier of the resource the rule monitors.

Parameters:

metricResourceUri - the metricResourceUri value to set.

Returns:

the MetricTrigger object itself.

withOperator

public MetricTrigger withOperator(ComparisonOperationType operator)

Set the operator property: the operator that is used to compare the metric data and the threshold.

Parameters:

operator - the operator value to set.

Returns:

the MetricTrigger object itself.

withStatistic

public MetricTrigger withStatistic(MetricStatisticType statistic)

Set the statistic property: the metric statistic type. How the metrics from multiple instances are combined.

Parameters:

statistic - the statistic value to set.

Returns:

the MetricTrigger object itself.

withThreshold

public MetricTrigger withThreshold(double threshold)

Set the threshold property: the threshold of the metric that triggers the scale action.

Parameters:

threshold - the threshold value to set.

Returns:

the MetricTrigger object itself.

withTimeAggregation

public MetricTrigger withTimeAggregation(TimeAggregationType timeAggregation)

Set the timeAggregation property: time aggregation type. How the data that is collected should be combined over time. The default value is Average.

Parameters:

timeAggregation - the timeAggregation value to set.

Returns:

the MetricTrigger object itself.

withTimeGrain

public MetricTrigger withTimeGrain(Duration timeGrain)

Set the timeGrain property: the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.

Parameters:

timeGrain - the timeGrain value to set.

Returns:

the MetricTrigger object itself.

withTimeWindow

public MetricTrigger withTimeWindow(Duration timeWindow)

Set the timeWindow property: the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.

Parameters:

timeWindow - the timeWindow value to set.

Returns:

the MetricTrigger object itself.

Applies to