Прочетете на английски

Споделяне чрез


MetricCollector<T> Class

Definition

Collects the measurements published from an Instrument<T> or ObservableInstrument<T>.

C#
public sealed class MetricCollector<T> : IDisposable where T : struct

Type Parameters

T

The type of metric data being recorded.

Inheritance
MetricCollector<T>
Implements

Constructors

Properties

Instrument

Gets the Instrument that is being recorded.

LastMeasurement

Gets the latest measurement collected, if any.

Methods

Clear()

Removes all accumulated measurements from the collector.

Dispose()

Disposes the MetricCollector<T> and stops recording measurements.

GetMeasurementSnapshot(Boolean)

Gets a snapshot of measurements collected by this collector.

RecordObservableInstruments()

Scan all registered observable instruments.

WaitForMeasurementsAsync(Int32, CancellationToken)

Returns a task that completes when the collector has collected a minimum number of measurements.

WaitForMeasurementsAsync(Int32, TimeSpan)

Returns a task that completes when the collector has collected a minimum number of measurements.

Applies to

Продукт Версии
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)