Meter.CreateCounter 方法

定义

重载

CreateCounter<T>(String, String, String)

Create指标计数器对象。

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

创建指标计数器对象。

CreateCounter<T>(String, String, String)

Source:
Meter.cs
Source:
Meter.cs
Source:
Meter.cs

Create指标计数器对象。

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>>)

Source:
Meter.cs
Source:
Meter.cs

创建指标计数器对象。

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 错误的数量。

适用于