你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
MetricTrigger 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 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)
参数
- metricName
- String
定义规则监视的指标的名称。
- metricResourceId
- ResourceIdentifier
规则监视的资源的资源标识符。
- timeGrain
- TimeSpan
规则监视的指标的粒度。 必须是从指标的指标定义返回的预定义值之一。 必须介于 12 小时和 1 分钟之间。
- statistic
- MetricStatisticType
指标统计信息类型。 来自多个实例的指标进行组合的方式。
- timeWindow
- TimeSpan
收集实例数据的时间范围。 此值必须大于指标集合中的延迟,可能会因资源而异。 必须介于 12 小时和 5 分钟之间。
- timeAggregation
- MetricTriggerTimeAggregationType
时间聚合类型。 随着时间推移,收集的数据应如何组合。 默认值为 Average。
- operator
- MetricTriggerComparisonOperation
用于比较指标数据和阈值的运算符。
- threshold
- Double
触发缩放操作的指标的阈值。
例外
metricName
或 metricResourceId
为 null。