Dela via


Meter.CreateUpDownCounter<T>(String, String, String) Method

Definition

Create an UpDownCounter, which is an instrument that can be used to track counts/sums which are not monotonic (can fluctuate in value).

public Microsoft.VisualStudio.Telemetry.Metrics.ICounter<T> CreateUpDownCounter<T> (string name, string unit = default, string description = default) where T : struct;
abstract member CreateUpDownCounter : string * string * string -> Microsoft.VisualStudio.Telemetry.Metrics.ICounter<'T (requires 'T : struct)> (requires 'T : struct)
override this.CreateUpDownCounter : string * string * string -> Microsoft.VisualStudio.Telemetry.Metrics.ICounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateUpDownCounter(Of T As Structure) (name As String, Optional unit As String = Nothing, Optional description As String = Nothing) As ICounter(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.

Implements

Exceptions

Throws if T is not a valid numeric type. For supported types, check documentation: Microsoft.VisualStudio.Telemetry.Metrics.Counter`1.

Applies to