Meter.CreateCounter 方法

定義

多載

CreateCounter<T>(String, String, String)

Create metrics Counter 物件。

CreateCounter<T>(String, String, String, IEnumerable<KeyValuePair<String,Object>>)

建立計量Counter物件。

CreateCounter<T>(String, String, String)

來源:
Meter.cs
來源:
Meter.cs
來源:
Meter.cs

Create metrics Counter 物件。

public System.Diagnostics.Metrics.Counter<T> CreateCounter<T> (string name, string? unit = default, string? description = default) where T : struct;
member this.CreateCounter : string * string * string -> System.Diagnostics.Metrics.Counter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateCounter(Of T As Structure) (name As String, Optional unit As String = Nothing, Optional description As String = Nothing) As Counter(Of T)

類型參數

T

測量的數值類型。

參數

name
String

檢測名稱。 不可以是 null

unit
String

選擇性的測量單位。

description
String

選擇性檢測描述。

傳回

新的計數器。

備註

計數器是支援非負增量的檢測。 計數器的範例用法:

  • 計算收到的位元組數目。
  • 計算完成的要求數目。
  • 計算建立的帳戶數目。
  • 計算執行檢查點的數目。
  • 計算 HTTP 5xx 錯誤的數目。

適用於

CreateCounter<T>(String, String, String, IEnumerable<KeyValuePair<String,Object>>)

來源:
Meter.cs
來源:
Meter.cs

建立計量Counter物件。

public:
generic <typename T>
 where T : value class System::Diagnostics::Metrics::Counter<T> ^ CreateCounter(System::String ^ name, System::String ^ unit, System::String ^ description, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>> ^ tags);
public System.Diagnostics.Metrics.Counter<T> CreateCounter<T> (string name, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
member this.CreateCounter : string * string * string * seq<System.Collections.Generic.KeyValuePair<string, obj>> -> System.Diagnostics.Metrics.Counter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateCounter(Of T As Structure) (name As String, unit As String, description As String, tags As IEnumerable(Of KeyValuePair(Of String, Object))) As Counter(Of T)

類型參數

T

測量的數值類型。

參數

name
String

檢測名稱。 不可為 null

unit
String

選擇性的測量單位。

description
String

選擇性檢測描述。

tags
IEnumerable<KeyValuePair<String,Object>>

要附加至計數器的標記。

傳回

新的計數器。

備註

計數器是支援非負增量的檢測。

計數器的範例用法:

  • 計算收到的位元組數目。
  • 計算完成的要求數目。
  • 計算建立的帳戶數目。
  • 計算執行檢查點的數目。
  • 計算 HTTP 5xx 錯誤的數目。

適用於