Share via


MetricCollector<T> Constructors

Definition

Overloads

MetricCollector<T>(Instrument<T>, TimeProvider)

Initializes a new instance of the MetricCollector<T> class.

MetricCollector<T>(ObservableInstrument<T>, TimeProvider)

Initializes a new instance of the MetricCollector<T> class.

MetricCollector<T>(Meter, String, TimeProvider)

Initializes a new instance of the MetricCollector<T> class.

MetricCollector<T>(Object, String, String, TimeProvider)

Initializes a new instance of the MetricCollector<T> class.

MetricCollector<T>(Instrument<T>, TimeProvider)

Source:
MetricCollector.cs
Source:
MetricCollector.cs
Source:
MetricCollector.cs

Initializes a new instance of the MetricCollector<T> class.

public MetricCollector (System.Diagnostics.Metrics.Instrument<T> instrument, TimeProvider? timeProvider = default);
new Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)> : System.Diagnostics.Metrics.Instrument<'T (requires 'T : struct)> * TimeProvider -> Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)>
Public Sub New (instrument As Instrument(Of T), Optional timeProvider As TimeProvider = Nothing)

Parameters

instrument
Instrument<T>

The Instrument<T> to record measurements from.

timeProvider
TimeProvider

The time provider to use, or null to use the system time provider.

Applies to

MetricCollector<T>(ObservableInstrument<T>, TimeProvider)

Source:
MetricCollector.cs
Source:
MetricCollector.cs
Source:
MetricCollector.cs

Initializes a new instance of the MetricCollector<T> class.

public MetricCollector (System.Diagnostics.Metrics.ObservableInstrument<T> instrument, TimeProvider? timeProvider = default);
new Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)> : System.Diagnostics.Metrics.ObservableInstrument<'T (requires 'T : struct)> * TimeProvider -> Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)>
Public Sub New (instrument As ObservableInstrument(Of T), Optional timeProvider As TimeProvider = Nothing)

Parameters

instrument
ObservableInstrument<T>

The ObservableInstrument<T> to record measurements from.

timeProvider
TimeProvider

The time provider to use, or null to use the system time provider.

Applies to

MetricCollector<T>(Meter, String, TimeProvider)

Source:
MetricCollector.cs
Source:
MetricCollector.cs
Source:
MetricCollector.cs

Initializes a new instance of the MetricCollector<T> class.

public MetricCollector (System.Diagnostics.Metrics.Meter meter, string instrumentName, TimeProvider? timeProvider = default);
new Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)> : System.Diagnostics.Metrics.Meter * string * TimeProvider -> Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)>
Public Sub New (meter As Meter, instrumentName As String, Optional timeProvider As TimeProvider = Nothing)

Parameters

meter
Meter

The meter that publishes the instrument to record.

instrumentName
String

The name of the instrument to record.

timeProvider
TimeProvider

The time provider to use, or null to use the system time provider.

Applies to

MetricCollector<T>(Object, String, String, TimeProvider)

Source:
MetricCollector.cs
Source:
MetricCollector.cs
Source:
MetricCollector.cs

Initializes a new instance of the MetricCollector<T> class.

public MetricCollector (object? meterScope, string meterName, string instrumentName, TimeProvider? timeProvider = default);
new Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)> : obj * string * string * TimeProvider -> Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<'T (requires 'T : struct)>
Public Sub New (meterScope As Object, meterName As String, instrumentName As String, Optional timeProvider As TimeProvider = Nothing)

Parameters

meterScope
Object

The scope of the meter that publishes the instrument to record. Take caution when using Meters in the global scope (scope == null). This interacts with static mutable data and tests doing this should not be run in parallel with each other.

meterName
String

The name of the meter that publishes the instrument to record.

instrumentName
String

The name of the instrument to record.

timeProvider
TimeProvider

The time provider to use, or null to use the system time provider.

Remarks

Both the meter name and scope are used to identity the meter of interest.

Applies to