Прочитај на енглеском Уреди

Делите путем


Meter.CreateUpDownCounter Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

CreateUpDownCounter<T>(String, String, String)

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

Create a metrics UpDownCounter object.

C#
public System.Diagnostics.Metrics.UpDownCounter<T> CreateUpDownCounter<T>(string name, string? unit = default, string? description = default) where T : struct;

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 up down counter.

Remarks

UpDownCounter is an Instrument which supports reporting positive or negative metric values. Example uses for UpDownCounter: reporting the change in active requests or queue size.

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

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

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

Create a metrics UpDownCounter object.

C#
public System.Diagnostics.Metrics.UpDownCounter<T> CreateUpDownCounter<T>(string name, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
C#
public System.Diagnostics.Metrics.UpDownCounter<T> CreateUpDownCounter<T>(string name, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>>? tags) where T : struct;

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.

tags
IEnumerable<KeyValuePair<String,Object>>

tags to attach to the counter.

Returns

A new up down counter.

Remarks

UpDownCounter is an Instrument which supports reporting positive or negative metric values. Example uses for UpDownCounter: reporting the change in active requests or queue size.

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)