语言

MetricCollector<T> 类

定义

generic <typename T>
 where T : value classpublic ref class MetricCollector sealed : IDisposable
public sealed class MetricCollector<T> : IDisposable where T : struct
type MetricCollector<'T (requires 'T : struct)> = class
    interface IDisposable
Public NotInheritable Class MetricCollector(Of T)
Implements IDisposable

类型参数

T

要记录的指标数据类型。

继承
MetricCollector<T>
实现

构造函数

名称 说明
MetricCollector<T>(Instrument<T>, TimeProvider)

初始化 MetricCollector<T> 类的新实例。

MetricCollector<T>(Meter, String, TimeProvider)

初始化 MetricCollector<T> 类的新实例。

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

初始化 MetricCollector<T> 类的新实例。

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

初始化 MetricCollector<T> 类的新实例。

属性

名称 说明
Instrument

Instrument获取正在记录的项。

LastMeasurement

获取收集的最新度量值(如果有)。

方法

名称 说明
Clear()

从收集器中删除所有累积度量值。

Dispose()

释放 MetricCollector<T> 并停止记录度量。

GetMeasurementSnapshot(Boolean)

获取此收集器收集的度量快照。

RecordObservableInstruments()

记录所有已注册的可观测仪器。

WaitForMeasurementsAsync(Int32, CancellationToken)

返回收集器收集最小度量值时完成的任务。

WaitForMeasurementsAsync(Int32, TimeSpan)

返回收集器收集最小度量值时完成的任务。

适用于