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
System.String
metricValue
System.Double

Exceptions

System.ArgumentException

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
System.String

Metric name.

count
System.Int32

Count of values taken during aggregation interval.

sum
System.Double

Sum of values taken during aggregation interval.

min
System.Double

Minimum value taken during aggregation interval.

max
System.Double

Maximum of values taken during aggregation interval.

standardDeviation
System.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
System.String

Metric namespace.

name
System.String

Metric name.

count
System.Int32

Count of values taken during aggregation interval.

sum
System.Double

Sum of values taken during aggregation interval.

min
System.Double

Minimum value taken during aggregation interval.

max
System.Double

Maximum of values taken during aggregation interval.

standardDeviation
System.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