共用方式為


MetricTelemetry Constructors

Definition

Overloads

MetricTelemetry()

Initializes a new instance of the MetricTelemetry class with empty properties.

MetricTelemetry(String, Double)

Obsolete - use MetricTelemetry(name,count,sum,min,max,standardDeviation). Initializes a new instance of the MetricTelemetry class with the specified metricName and metricValue.

MetricTelemetry(String, Int32, Double, Double, Double, Double)

Initializes a new instance of the MetricTelemetry class with properties provided.

MetricTelemetry(String, String, Int32, Double, Double, Double, Double)

Initializes a new instance of the MetricTelemetry class with properties provided.

MetricTelemetry()

Initializes a new instance of the MetricTelemetry class with empty properties.

public MetricTelemetry ();
Public Sub New ()

Applies to

MetricTelemetry(String, Double)

Obsolete - use MetricTelemetry(name,count,sum,min,max,standardDeviation). Initializes a new instance of the MetricTelemetry class with the specified metricName and 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)

Parameters

metricName
String
metricValue
Double

Exceptions

The metricName is null or empty string.

Applies to

MetricTelemetry(String, Int32, Double, Double, Double, Double)

Initializes a new instance of the MetricTelemetry class with properties provided.

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)

Parameters

name
String

Metric name.

count
Int32

Count of values taken during aggregation interval.

sum
Double

Sum of values taken during aggregation interval.

min
Double

Minimum value taken during aggregation interval.

max
Double

Maximum of values taken during aggregation interval.

standardDeviation
Double

Standard deviation of values taken during aggregation interval.

Remarks

Metrics should always be pre-aggregated across a time period before being sent. Most applications do not need to explicitly create MetricTelemetry objects. Instead, use one of the GetMetric(..) overloads on the TelemetryClient class to get a metric object for accessing SDK pre-aggregation capabilities.
However, you can use this ctor to create metric telemetry items if you have implemented your own metric aggregation. In that case, use Microsoft.ApplicationInsights.TelemetryClient.Track(Microsoft.ApplicationInsights.Channel.ITelemetry) method to send your aggregates.

Applies to

MetricTelemetry(String, String, Int32, Double, Double, Double, Double)

Initializes a new instance of the MetricTelemetry class with properties provided.

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)

Parameters

metricNamespace
String

Metric namespace.

name
String

Metric name.

count
Int32

Count of values taken during aggregation interval.

sum
Double

Sum of values taken during aggregation interval.

min
Double

Minimum value taken during aggregation interval.

max
Double

Maximum of values taken during aggregation interval.

standardDeviation
Double

Standard deviation of values taken during aggregation interval.

Remarks

Metrics should always be pre-aggregated across a time period before being sent. Most applications do not need to explicitly create MetricTelemetry objects. Instead, use one of the GetMetric(..) overloads on the TelemetryClient class to get a metric object for accessing SDK pre-aggregation capabilities.
However, you can use this ctor to create metric telemetry items if you have implemented your own metric aggregation. In that case, use Microsoft.ApplicationInsights.TelemetryClient.Track(Microsoft.ApplicationInsights.Channel.ITelemetry) method to send your aggregates.

Applies to