Counter<T> 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表一種支援加非負值的工具。 例如,你可能會在每次處理請求時打電話追蹤 counter.Add(1) 總請求數量。 大多數指標檢視器預設會以速率(請求數/秒)顯示計數器,但也能顯示累積總數。
generic <typename T>
where T : value classpublic ref class Counter sealed : System::Diagnostics::Metrics::Instrument<T>
public sealed class Counter<T> : System.Diagnostics.Metrics.Instrument<T> where T : struct
type Counter<'T (requires 'T : struct)> = class
inherit Instrument<'T (requires 'T : struct)>
Public NotInheritable Class Counter(Of T)
Inherits Instrument(Of T)
類型參數
- T
計數器所代表的類型。
- 繼承
備註
此類別僅支援以下一般參數類型:Byte、Int64Int32SingleInt16Double及。Decimal
屬性
| 名稱 | Description |
|---|---|
| Advice |
與 InstrumentAdvice<T> 樂器相關。 (繼承來源 Instrument<T>) |
| Description |
拿到樂器描述。 (繼承來源 Instrument) |
| Enabled |
會有一個值,表示是否有聽眾聽這個樂器。 (繼承來源 Instrument) |
| IsObservable |
會得到一個值,表示該儀器是否為可觀測儀器。 (繼承來源 Instrument) |
| Meter |
取得製作該儀器的計量器。 (繼承來源 Instrument) |
| Name |
他會拿到樂器名稱。 (繼承來源 Instrument) |
| Tags |
回傳與該儀器相關的標籤。 (繼承來源 Instrument) |
| Unit |
取得儀器的計量單位。 (繼承來源 Instrument) |