你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
MetricTelemetry 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
MetricTelemetry() |
使用空属性初始化 类的新实例 MetricTelemetry 。 |
MetricTelemetry(String, Double) |
已过时 - 使用 MetricTelemetry (name、count、sum、min、max、standardDeviation) 。 使用指定的 MetricTelemetry 和 |
MetricTelemetry(String, Int32, Double, Double, Double, Double) |
使用提供的属性初始化 类的新实例 MetricTelemetry 。 |
MetricTelemetry(String, String, Int32, Double, Double, Double, Double) |
使用提供的属性初始化 类的新实例 MetricTelemetry 。 |
MetricTelemetry()
MetricTelemetry(String, Double)
已过时 - 使用 MetricTelemetry (name、count、sum、min、max、standardDeviation) 。 使用指定的 MetricTelemetry 和 metricName
初始化 metricValue
类的新实例。
public MetricTelemetry(string metricName, double metricValue);
new Microsoft.ApplicationInsights.DataContracts.MetricTelemetry : string * double -> Microsoft.ApplicationInsights.DataContracts.MetricTelemetry
Public Sub New (metricName As String, metricValue As Double)
参数
- metricName
- String
- metricValue
- Double
例外
为 metricName
null 或空字符串。
适用于
MetricTelemetry(String, Int32, Double, Double, Double, Double)
使用提供的属性初始化 类的新实例 MetricTelemetry 。
public MetricTelemetry(string name, int count, double sum, double min, double max, double standardDeviation);
new Microsoft.ApplicationInsights.DataContracts.MetricTelemetry : string * int * double * double * double * double -> Microsoft.ApplicationInsights.DataContracts.MetricTelemetry
Public Sub New (name As String, count As Integer, sum As Double, min As Double, max As Double, standardDeviation As Double)
参数
- name
- String
指标名称。
- count
- Int32
聚合间隔期间获取的值计数。
- sum
- Double
聚合间隔期间采用的值的总和。
- min
- Double
聚合间隔期间采用的最小值。
- max
- Double
聚合间隔期间获取的最大值。
- standardDeviation
- Double
聚合间隔期间获取的值的标准偏差。
注解
在发送之前,应当始终对一段时间内的指标进行预聚合。 大多数应用程序不需要显式创建 MetricTelemetry
对象。 请改用 类上的GetMetric(..)
TelemetryClient某个重载来获取用于访问 SDK 预聚合功能的指标对象。
但是,如果已实现自己的指标聚合,则可以使用此函数创建指标遥测项。 在这种情况下,请使用 Microsoft.ApplicationInsights.TelemetryClient.Track(Microsoft.ApplicationInsights.Channel.ITelemetry) 方法发送聚合。
适用于
MetricTelemetry(String, String, Int32, Double, Double, Double, Double)
使用提供的属性初始化 类的新实例 MetricTelemetry 。
public MetricTelemetry(string metricNamespace, string name, int count, double sum, double min, double max, double standardDeviation);
new Microsoft.ApplicationInsights.DataContracts.MetricTelemetry : string * string * int * double * double * double * double -> Microsoft.ApplicationInsights.DataContracts.MetricTelemetry
Public Sub New (metricNamespace As String, name As String, count As Integer, sum As Double, min As Double, max As Double, standardDeviation As Double)
参数
- metricNamespace
- String
指标命名空间。
- name
- String
指标名称。
- count
- Int32
聚合间隔期间获取的值计数。
- sum
- Double
聚合间隔期间采用的值的总和。
- min
- Double
聚合间隔期间采用的最小值。
- max
- Double
聚合间隔期间获取的最大值。
- standardDeviation
- Double
聚合间隔期间获取的值的标准偏差。
注解
在发送之前,应当始终对一段时间内的指标进行预聚合。 大多数应用程序不需要显式创建 MetricTelemetry
对象。 请改用 类上的GetMetric(..)
TelemetryClient某个重载来获取用于访问 SDK 预聚合功能的指标对象。
但是,如果已实现自己的指标聚合,则可以使用此函数创建指标遥测项。 在这种情况下,请使用 Microsoft.ApplicationInsights.TelemetryClient.Track(Microsoft.ApplicationInsights.Channel.ITelemetry) 方法发送聚合。