Class MetricTrigger
java.lang.Object
com.microsoft.azure.management.monitor.MetricTrigger
The trigger that results in a scaling action.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the name of the metric that defines what the rule monitors.Get the resource identifier of the resource the rule monitors.operator()
Get the operator that is used to compare the metric data and the threshold.Get the metric statistic type.double
Get the threshold of the metric that triggers the scale action.Get time aggregation type.org.joda.time.Period
Get the granularity of metrics the rule monitors.org.joda.time.Period
Get the range of time in which instance data is collected.withMetricName
(String metricName) Set the name of the metric that defines what the rule monitors.withMetricResourceUri
(String metricResourceUri) Set the resource identifier of the resource the rule monitors.withOperator
(ComparisonOperationType operator) Set the operator that is used to compare the metric data and the threshold.withStatistic
(MetricStatisticType statistic) Set the metric statistic type.withThreshold
(double threshold) Set the threshold of the metric that triggers the scale action.withTimeAggregation
(TimeAggregationType timeAggregation) Set time aggregation type.withTimeGrain
(org.joda.time.Period timeGrain) Set the granularity of metrics the rule monitors.withTimeWindow
(org.joda.time.Period timeWindow) Set the range of time in which instance data is collected.
-
Constructor Details
-
MetricTrigger
public MetricTrigger()
-
-
Method Details
-
metricName
Get the name of the metric that defines what the rule monitors.- Returns:
- the metricName value
-
withMetricName
Set the name of the metric that defines what the rule monitors.- Parameters:
metricName
- the metricName value to set- Returns:
- the MetricTrigger object itself.
-
metricResourceUri
Get the resource identifier of the resource the rule monitors.- Returns:
- the metricResourceUri value
-
withMetricResourceUri
Set the resource identifier of the resource the rule monitors.- Parameters:
metricResourceUri
- the metricResourceUri value to set- Returns:
- the MetricTrigger object itself.
-
timeGrain
public org.joda.time.Period timeGrain()Get 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
-
withTimeGrain
Set 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.
-
statistic
Get the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'Average', 'Min', 'Max', 'Sum'.- Returns:
- the statistic value
-
withStatistic
Set the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'Average', 'Min', 'Max', 'Sum'.- Parameters:
statistic
- the statistic value to set- Returns:
- the MetricTrigger object itself.
-
timeWindow
public org.joda.time.Period timeWindow()Get 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
-
withTimeWindow
Set 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.
-
timeAggregation
Get time aggregation type. How the data that is collected should be combined over time. The default value is Average. Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', 'Count', 'Last'.- Returns:
- the timeAggregation value
-
withTimeAggregation
Set time aggregation type. How the data that is collected should be combined over time. The default value is Average. Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', 'Count', 'Last'.- Parameters:
timeAggregation
- the timeAggregation value to set- Returns:
- the MetricTrigger object itself.
-
operator
Get the operator that is used to compare the metric data and the threshold. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'.- Returns:
- the operator value
-
withOperator
Set the operator that is used to compare the metric data and the threshold. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'.- Parameters:
operator
- the operator value to set- Returns:
- the MetricTrigger object itself.
-
threshold
public double threshold()Get the threshold of the metric that triggers the scale action.- Returns:
- the threshold value
-
withThreshold
Set the threshold of the metric that triggers the scale action.- Parameters:
threshold
- the threshold value to set- Returns:
- the MetricTrigger object itself.
-