Delen via


MetricTrigger Constructor

Definition

Initializes a new instance of MetricTrigger.

public MetricTrigger (string metricName, Azure.Core.ResourceIdentifier metricResourceId, TimeSpan timeGrain, Azure.ResourceManager.Monitor.Models.MetricStatisticType statistic, TimeSpan timeWindow, Azure.ResourceManager.Monitor.Models.MetricTriggerTimeAggregationType timeAggregation, Azure.ResourceManager.Monitor.Models.MetricTriggerComparisonOperation operator, double threshold);
new Azure.ResourceManager.Monitor.Models.MetricTrigger : string * Azure.Core.ResourceIdentifier * TimeSpan * Azure.ResourceManager.Monitor.Models.MetricStatisticType * TimeSpan * Azure.ResourceManager.Monitor.Models.MetricTriggerTimeAggregationType * Azure.ResourceManager.Monitor.Models.MetricTriggerComparisonOperation * double -> Azure.ResourceManager.Monitor.Models.MetricTrigger
Public Sub New (metricName As String, metricResourceId As ResourceIdentifier, timeGrain As TimeSpan, statistic As MetricStatisticType, timeWindow As TimeSpan, timeAggregation As MetricTriggerTimeAggregationType, operator As MetricTriggerComparisonOperation, threshold As Double)

Parameters

metricName
String

the name of the metric that defines what the rule monitors.

metricResourceId
ResourceIdentifier

the resource identifier of the resource the rule monitors.

timeGrain
TimeSpan

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.

statistic
MetricStatisticType

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

timeWindow
TimeSpan

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.

timeAggregation
MetricTriggerTimeAggregationType

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

operator
MetricTriggerComparisonOperation

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

threshold
Double

the threshold of the metric that triggers the scale action.

Exceptions

metricName or metricResourceId is null.

Applies to