Meter.CreateObservableCounter 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
CreateObservableCounter<T>(String, Func<T>, String, String, IEnumerable<KeyValuePair<String,Object>>) |
建立 ObservableCounter 實例,這是一個檢測,它會在觀察到檢測時,以單調方式報告 (s) 的值。 |
CreateObservableCounter<T>(String, Func<Measurement<T>>, String, String, IEnumerable<KeyValuePair<String,Object>>) |
建立 ObservableCounter 實例,這是一個檢測,它會在觀察到檢測時,以單調方式報告 (s) 的值。 |
CreateObservableCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String, IEnumerable<KeyValuePair<String,Object>>) |
建立 ObservableCounter 實例,這是一個檢測,它會在觀察到檢測時,以單調方式報告 (s) 的值。 |
CreateObservableCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String) |
建立 ObservableCounter,這是在觀察檢測時報告單調增加值的檢測。 |
CreateObservableCounter<T>(String, Func<Measurement<T>>, String, String) |
建立 ObservableCounter,這是在觀察檢測時報告單調增加值的檢測。 |
CreateObservableCounter<T>(String, Func<T>, String, String) |
建立 ObservableCounter,這是在觀察檢測時報告單調增加值的檢測。 |
CreateObservableCounter<T>(String, Func<T>, String, String, IEnumerable<KeyValuePair<String,Object>>)
- 來源:
- Meter.cs
- 來源:
- Meter.cs
建立 ObservableCounter 實例,這是一個檢測,它會在觀察到檢測時,以單調方式報告 (s) 的值。
public:
generic <typename T>
where T : value class System::Diagnostics::Metrics::ObservableCounter<T> ^ CreateObservableCounter(System::String ^ name, Func<T> ^ observeValue, System::String ^ unit, System::String ^ description, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>> ^ tags);
public System.Diagnostics.Metrics.ObservableCounter<T> CreateObservableCounter<T> (string name, Func<T> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
member this.CreateObservableCounter : string * Func<'T (requires 'T : struct)> * string * string * seq<System.Collections.Generic.KeyValuePair<string, obj>> -> System.Diagnostics.Metrics.ObservableCounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateObservableCounter(Of T As Structure) (name As String, observeValue As Func(Of T), unit As String, description As String, tags As IEnumerable(Of KeyValuePair(Of String, Object))) As ObservableCounter(Of T)
類型參數
- T
測量的數值類型。
參數
- name
- String
檢測名稱。 不可為 null
。
- observeValue
- Func<T>
呼叫 以在呼叫 RecordObservableInstruments()時Observe()取得度量的回呼。
- unit
- String
選擇性的測量單位。
- description
- String
選擇性檢測描述。
- tags
- IEnumerable<KeyValuePair<String,Object>>
要附加至計數器的標記。
傳回
新的可觀察計數器。
備註
ObservableCounter 的範例用法:每個進程的頁面錯誤數目。
適用於
CreateObservableCounter<T>(String, Func<Measurement<T>>, String, String, IEnumerable<KeyValuePair<String,Object>>)
- 來源:
- Meter.cs
- 來源:
- Meter.cs
建立 ObservableCounter 實例,這是一個檢測,它會在觀察到檢測時,以單調方式報告 (s) 的值。
public:
generic <typename T>
where T : value class System::Diagnostics::Metrics::ObservableCounter<T> ^ CreateObservableCounter(System::String ^ name, Func<System::Diagnostics::Metrics::Measurement<T>> ^ observeValue, System::String ^ unit, System::String ^ description, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>> ^ tags);
public System.Diagnostics.Metrics.ObservableCounter<T> CreateObservableCounter<T> (string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
member this.CreateObservableCounter : string * Func<System.Diagnostics.Metrics.Measurement<'T>> * string * string * seq<System.Collections.Generic.KeyValuePair<string, obj>> -> System.Diagnostics.Metrics.ObservableCounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateObservableCounter(Of T As Structure) (name As String, observeValue As Func(Of Measurement(Of T)), unit As String, description As String, tags As IEnumerable(Of KeyValuePair(Of String, Object))) As ObservableCounter(Of T)
類型參數
- T
測量的數值類型。
參數
- name
- String
檢測名稱。 不可為 null
。
- observeValue
- Func<Measurement<T>>
呼叫 的回呼,以在呼叫 時 Observe() 取得度量 RecordObservableInstruments()
- unit
- String
選擇性的測量單位。
- description
- String
選擇性檢測描述。
- tags
- IEnumerable<KeyValuePair<String,Object>>
要附加至計數器的標記。
傳回
新的可觀察計數器。
備註
ObservableCounter 的範例用法:每個進程的頁面錯誤數目。
適用於
CreateObservableCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String, IEnumerable<KeyValuePair<String,Object>>)
- 來源:
- Meter.cs
- 來源:
- Meter.cs
建立 ObservableCounter 實例,這是一個檢測,它會在觀察到檢測時,以單調方式報告 (s) 的值。
public:
generic <typename T>
where T : value class System::Diagnostics::Metrics::ObservableCounter<T> ^ CreateObservableCounter(System::String ^ name, Func<System::Collections::Generic::IEnumerable<System::Diagnostics::Metrics::Measurement<T>> ^> ^ observeValues, System::String ^ unit, System::String ^ description, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>> ^ tags);
public System.Diagnostics.Metrics.ObservableCounter<T> CreateObservableCounter<T> (string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
member this.CreateObservableCounter : string * Func<seq<System.Diagnostics.Metrics.Measurement<'T>>> * string * string * seq<System.Collections.Generic.KeyValuePair<string, obj>> -> System.Diagnostics.Metrics.ObservableCounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateObservableCounter(Of T As Structure) (name As String, observeValues As Func(Of IEnumerable(Of Measurement(Of T))), unit As String, description As String, tags As IEnumerable(Of KeyValuePair(Of String, Object))) As ObservableCounter(Of T)
類型參數
- T
測量的數值類型。
參數
- name
- String
檢測名稱。 不可為 null
。
- observeValues
- Func<IEnumerable<Measurement<T>>>
呼叫 以在呼叫 RecordObservableInstruments()時Observe()取得度量的回呼。
- unit
- String
選擇性的測量單位。
- description
- String
選擇性檢測描述。
- tags
- IEnumerable<KeyValuePair<String,Object>>
要附加至計數器的標記。
傳回
新的可觀察計數器。
備註
ObservableCounter 的範例用法:每個進程的頁面錯誤數目。
適用於
CreateObservableCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String)
- 來源:
- Meter.cs
- 來源:
- Meter.cs
- 來源:
- Meter.cs
建立 ObservableCounter,這是在觀察檢測時報告單調增加值的檢測。
public System.Diagnostics.Metrics.ObservableCounter<T> CreateObservableCounter<T> (string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, string? unit = default, string? description = default) where T : struct;
member this.CreateObservableCounter : string * Func<seq<System.Diagnostics.Metrics.Measurement<'T>>> * string * string -> System.Diagnostics.Metrics.ObservableCounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateObservableCounter(Of T As Structure) (name As String, observeValues As Func(Of IEnumerable(Of Measurement(Of T))), Optional unit As String = Nothing, Optional description As String = Nothing) As ObservableCounter(Of T)
類型參數
- T
測量的數值類型。
參數
- name
- String
檢測名稱。 不可以是 null
。
- observeValues
- Func<IEnumerable<Measurement<T>>>
呼叫 以在呼叫 RecordObservableInstruments()時取得度量的ObservableCounter{T}.Observe()
回呼。
- unit
- String
選擇性的測量單位。
- description
- String
選擇性檢測描述。
傳回
新的可觀察計數器。
備註
ObservableCounter 的範例用法:每個進程的頁面錯誤數目。
適用於
CreateObservableCounter<T>(String, Func<Measurement<T>>, String, String)
- 來源:
- Meter.cs
- 來源:
- Meter.cs
- 來源:
- Meter.cs
建立 ObservableCounter,這是在觀察檢測時報告單調增加值的檢測。
public System.Diagnostics.Metrics.ObservableCounter<T> CreateObservableCounter<T> (string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, string? unit = default, string? description = default) where T : struct;
member this.CreateObservableCounter : string * Func<System.Diagnostics.Metrics.Measurement<'T>> * string * string -> System.Diagnostics.Metrics.ObservableCounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateObservableCounter(Of T As Structure) (name As String, observeValue As Func(Of Measurement(Of T)), Optional unit As String = Nothing, Optional description As String = Nothing) As ObservableCounter(Of T)
類型參數
- T
測量的數值類型。
參數
- name
- String
檢測名稱。 不可以是 null
。
- observeValue
- Func<Measurement<T>>
呼叫 時要呼叫以取得度量的 ObservableCounter{T}.Observe()
回呼 RecordObservableInstruments()
- unit
- String
選擇性的測量單位。
- description
- String
選擇性檢測描述。
傳回
新的可觀察計數器。
備註
ObservableCounter 的範例用法:每個進程的頁面錯誤數目。
適用於
CreateObservableCounter<T>(String, Func<T>, String, String)
- 來源:
- Meter.cs
- 來源:
- Meter.cs
- 來源:
- Meter.cs
建立 ObservableCounter,這是在觀察檢測時報告單調增加值的檢測。
public System.Diagnostics.Metrics.ObservableCounter<T> CreateObservableCounter<T> (string name, Func<T> observeValue, string? unit = default, string? description = default) where T : struct;
member this.CreateObservableCounter : string * Func<'T (requires 'T : struct)> * string * string -> System.Diagnostics.Metrics.ObservableCounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateObservableCounter(Of T As Structure) (name As String, observeValue As Func(Of T), Optional unit As String = Nothing, Optional description As String = Nothing) As ObservableCounter(Of T)
類型參數
- T
度量的數值類型。
參數
- name
- String
檢測名稱。 不可以是 null
。
- observeValue
- Func<T>
呼叫 以在呼叫 RecordObservableInstruments()時取得度量的ObservableCounter{T}.Observe()
回呼。
- unit
- String
選擇性的測量單位。
- description
- String
選擇性檢測描述。
傳回
新的可觀察計數器。
備註
ObservableCounter 的範例用法:每個進程的頁面錯誤數目。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應