Metric Class
Definition
A Metric which will aggregate values over a time interval
public sealed class Metric : IDisposableInheritance object
Implements IDisposable
Constructors
Metric(string, TelemetryClient, TimeSpan)
Initializes a new instance of the Metric class.
public Metric(string name, TelemetryClient telemetryClient, TimeSpan aggregationPeriod)Parameters
name string
The name associated with the Metric.
telemetryClient TelemetryClient
Application Insights Telemetry Client used to send Metrics.
aggregationPeriod TimeSpan
TimeSpan over which metrics should be aggregated before sending to Application Insights.
Properties
Name
Gets the name associated with this Metric.
public string Name { get; }Methods
TrackValue(double)
Tracks a single value to be aggregated.
public void TrackValue(double value)Parameters
value double
The value to be tracked.