IncrementingEventCounter 类

定义

为不断增加的 EventCounter 变量(例如运行时中的异常数)提供变体。

public ref class IncrementingEventCounter : System::Diagnostics::Tracing::DiagnosticCounter
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public class IncrementingEventCounter : System.Diagnostics.Tracing.DiagnosticCounter
public class IncrementingEventCounter : System.Diagnostics.Tracing.DiagnosticCounter
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type IncrementingEventCounter = class
    inherit DiagnosticCounter
type IncrementingEventCounter = class
    inherit DiagnosticCounter
Public Class IncrementingEventCounter
Inherits DiagnosticCounter
继承
IncrementingEventCounter
属性

注解

IncrementingEventCounter 用于跟踪始终增加的值,例如请求总数、引发的异常总数等。对于此类指标,只需报告总值并不一定可用于监视其运行状况。 例如,跟踪在整个进程期间总共分配了多少个字节,对于诊断分配过多内存的任何潜在问题并无用处。 一个指标,可帮助我们分配过去一分钟、小时或一些任意时间间隔中的字节数,而不是整个进程的持续时间。 IncrementingEventCounter 可用于跟踪和报告指标使用者指定的时间间隔的增量。

IncrementingEventCounter 不计算平均值或标准偏差等统计信息,因为它只跟踪一段时间内的增量。

构造函数

名称 说明
IncrementingEventCounter(String, EventSource)

初始化 IncrementingEventCounter 类的新实例。

属性

名称 说明
DisplayName

获取或设置计数器的显示名称。

(继承自 DiagnosticCounter)
DisplayRateTimeScale

获取或设置此指标应显示为的速率。

DisplayUnits

获取或设置计数器的显示单位。

(继承自 DiagnosticCounter)
EventSource

获取此计数器附加到的 EventSource。

(继承自 DiagnosticCounter)
Name

获取此计数器的名称。

(继承自 DiagnosticCounter)

方法

名称 说明
AddMetadata(String, String)

将键值元数据添加到将作为有效负载的一部分包含的计数器。

(继承自 DiagnosticCounter)
Dispose()

从将要报告的集中 EventSource 删除计数器。

(继承自 DiagnosticCounter)
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
Increment(Double)

将值添加到计数器将在下一个计时器间隔内发布的正在运行的总计。

MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回当前递增事件计数器实例的字符串表示形式。

适用于

另请参阅