Share via


MetricsCollection Class

Definition

A collection of metrics available at a specific scope. A metric is itself a colection of data time series identified by dimension name-values.

public sealed class MetricsCollection : System.Collections.Generic.ICollection<Microsoft.ApplicationInsights.Metric>, System.Collections.Generic.IEnumerable<Microsoft.ApplicationInsights.Metric>
type MetricsCollection = class
    interface ICollection<Metric>
    interface seq<Metric>
    interface IEnumerable
Public NotInheritable Class MetricsCollection
Implements ICollection(Of Metric), IEnumerable(Of Metric)
Inheritance
MetricsCollection
Implements

Properties

Count

Gets the number of metrics in this collection.

IsReadOnly

Gets a value indicating whether this collection is read-only. It is not.

Methods

Clear()

Removes all metrics from this collection.

Contains(Metric)

Checks if a metric is present in this collection.

Contains(MetricIdentifier)

Checks if a metric with th specified identity is present in this collection.

CopyTo(Metric[], Int32)

Copies the contents of this collection to the specified array.

GetEnumerator()

Gets an enumerator for this collection.

GetOrCreate(MetricIdentifier, MetricConfiguration)

Gets the specified metric, or creates one if no such metric exists.

Remove(Metric)

Removes the specified metric from this collection.

Remove(MetricIdentifier, Metric)

Removes a metric with the specified identity from this collection.

Remove(MetricIdentifier)

Removes a metric with the specified identity from this collection.

TryGet(MetricIdentifier, Metric)

Gets the metric with the specified identify, if it exists.

Explicit Interface Implementations

ICollection<Metric>.Add(Metric)

The Add(..) method is not supported. To add a new metric, use the GetOrCreate(..) method.

IEnumerable.GetEnumerator()

Gets an enumerator for this collection.

Applies to