EventCounter 類別

定義

可讓您透過 EventSource 類別收集非常頻繁事件的統計數據。

public ref class EventCounter : System::Diagnostics::Tracing::DiagnosticCounter
public ref class EventCounter
public ref class EventCounter : IDisposable
public class EventCounter : System.Diagnostics.Tracing.DiagnosticCounter
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public class EventCounter : System.Diagnostics.Tracing.DiagnosticCounter
public class EventCounter
public class EventCounter : IDisposable
type EventCounter = class
    inherit DiagnosticCounter
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type EventCounter = class
    inherit DiagnosticCounter
type EventCounter = class
type EventCounter = class
    interface IDisposable
Public Class EventCounter
Inherits DiagnosticCounter
Public Class EventCounter
Public Class EventCounter
Implements IDisposable
繼承
EventCounter
繼承
EventCounter
屬性
實作

備註

如需如何使用 EventCounter 類別的範例,請參閱 簡介教學課程:如何使用 EventCounters 測量非常頻繁事件的效能

建構函式

EventCounter(String, EventSource)

初始化 EventCounter 類別的新執行個體。

屬性

DisplayName

取得或設定計數器的顯示名稱。

(繼承來源 DiagnosticCounter)
DisplayUnits

取得或設定計數器的顯示單位。

(繼承來源 DiagnosticCounter)
EventSource

取得此計數器所附加的 EventSource。

(繼承來源 DiagnosticCounter)
Name

取得此計數器的名稱。

(繼承來源 DiagnosticCounter)

方法

AddMetadata(String, String)

將索引鍵/值中繼資料新增至將作為承載一部分的計數器。

(繼承來源 DiagnosticCounter)
Dispose()

EventSource 報告的集合中移除計數器。

Dispose()

EventSource 報告的集合中移除計數器。

(繼承來源 DiagnosticCounter)
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回目前事件計數器執行個體的字串表示。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
WriteMetric(Double)

如果效能計數器開啟,會寫入計量。

WriteMetric(Single)

如果效能計數器開啟,會寫入計量。

適用於

另請參閱