Upraviť

Zdieľať cez


Meter.CreateCounter Method

Definition

Overloads

CreateCounter<T>(String, String, String)

Create a metrics Counter object.

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

Creates a metrics Counter object.

CreateCounter<T>(String, String, String)

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

Create a metrics Counter object.

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)

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. Cannot be null.

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

Returns

A new counter.

Remarks

Counter is an instrument that supports non-negative increments. Example uses for Counter:

  • Count the number of bytes received.
  • Count the number of requests completed.
  • Count the number of accounts created.
  • Count the number of checkpoints run.
  • Count the number of HTTP 5xx errors.

Applies to

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

Source:
Meter.cs
Source:
Meter.cs

Creates a metrics Counter object.

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)

Type Parameters

T

The numerical type of the measurement.

Parameters

name
String

The instrument name. It cannot be null.

unit
String

An optional instrument unit of measurements.

description
String

An optional instrument description.

tags
IEnumerable<KeyValuePair<String,Object>>

The tags to attach to the counter.

Returns

A new counter.

Remarks

Counter is an Instrument that supports non-negative increments.

Example uses for Counter:

  • Count the number of bytes received.
  • Count the number of requests completed.
  • Count the number of accounts created.
  • Count the number of checkpoints run.
  • Count the number of HTTP 5xx errors.

Applies to