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

Делите путем


Meter.CreateObservableUpDownCounter Method

Definition

Overloads

CreateObservableUpDownCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String)

Creates an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument that reports increasing or decreasing values when the instrument is being observed.

CreateObservableUpDownCounter<T>(String, Func<Measurement<T>>, String, String)

Creates an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument that reports increasing or decreasing values when the instrument is being observed.

CreateObservableUpDownCounter<T>(String, Func<T>, String, String)

Creates an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument that reports increasing or decreasing values when the instrument is being observed.

CreateObservableUpDownCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

Create an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument which reports increasing or decreasing value(s) when the instrument is being observed.

CreateObservableUpDownCounter<T>(String, Func<Measurement<T>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

Create an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument which reports increasing or decreasing value(s) when the instrument is being observed.

CreateObservableUpDownCounter<T>(String, Func<T>, String, String, IEnumerable<KeyValuePair<String,Object>>)

Create an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument which reports increasing or decreasing value(s) when the instrument is being observed.

CreateObservableUpDownCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String)

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

Creates an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument that reports increasing or decreasing values when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, 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.

observeValues
Func<IEnumerable<Measurement<T>>>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments().

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

Returns

A new observable up down counter.

Remarks

Напомена

Unlike UpDownCounter which takes the increment/delta value, the callback function reports the absolute value of the ObservableUpDownCounter. To determine the reported rate the ObservableUpDownCounter is changing, the difference between successive measurements is used.

Example uses for ObservableUpDownCounter: the process heap size or the approximate number of items in a lock-free circular buffer.

Applies to

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

CreateObservableUpDownCounter<T>(String, Func<Measurement<T>>, String, String)

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

Creates an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument that reports increasing or decreasing values when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, 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.

observeValue
Func<Measurement<T>>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments()

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

Returns

A new observable up down counter.

Remarks

Напомена

Unlike UpDownCounter which takes the increment/delta value, the callback function reports the absolute value of the ObservableUpDownCounter. To determine the reported rate the ObservableUpDownCounter is changing, the difference between successive measurements is used.

Example uses for ObservableUpDownCounter: the process heap size or the approximate number of items in a lock-free circular buffer.

Applies to

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

CreateObservableUpDownCounter<T>(String, Func<T>, String, String)

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

Creates an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument that reports increasing or decreasing values when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, 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.

observeValue
Func<T>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments().

unit
String

Optional instrument unit of measurements.

description
String

Optional instrument description.

Returns

A new observable up down counter.

Remarks

Напомена

Unlike UpDownCounter which takes the increment/delta value, the callback function reports the absolute value of the ObservableUpDownCounter. To determine the reported rate the ObservableUpDownCounter is changing, the difference between successive measurements is used.

Example uses for ObservableUpDownCounter: the process heap size or the approximate number of items in a lock-free circular buffer.

Applies to

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

CreateObservableUpDownCounter<T>(String, Func<IEnumerable<Measurement<T>>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

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

Create an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument which reports increasing or decreasing value(s) when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<System.Collections.Generic.IEnumerable<System.Diagnostics.Metrics.Measurement<T>>> observeValues, 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.

observeValues
Func<IEnumerable<Measurement<T>>>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments().

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

Remarks

Напомена

Unlike UpDownCounter, which takes the increment/delta value, the callback function reports the absolute value of the ObservableUpDownCounter. To determine the reported rate the ObservableUpDownCounter is changing, the difference between successive measurements is used.

Example uses for ObservableUpDownCounter: the process heap size or the approximate number of items in a lock-free circular buffer.

Applies to

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

CreateObservableUpDownCounter<T>(String, Func<Measurement<T>>, String, String, IEnumerable<KeyValuePair<String,Object>>)

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

Create an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument which reports increasing or decreasing value(s) when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<System.Diagnostics.Metrics.Measurement<T>> observeValue, 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.

observeValue
Func<Measurement<T>>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments()

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

Remarks

Напомена

Unlike UpDownCounter which takes the increment/delta value, the callback function reports the absolute value of the ObservableUpDownCounter. To determine the reported rate the ObservableUpDownCounter is changing, the difference between successive measurements is used.

Example uses for ObservableUpDownCounter: the process heap size or the approximate number of items in a lock-free circular buffer.

Applies to

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

CreateObservableUpDownCounter<T>(String, Func<T>, String, String, IEnumerable<KeyValuePair<String,Object>>)

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

Create an ObservableUpDownCounter object. ObservableUpDownCounter is an Instrument which reports increasing or decreasing value(s) when the instrument is being observed.

C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
C#
public System.Diagnostics.Metrics.ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, 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.

observeValue
Func<T>

The callback to call to get the measurements when the Observe() is called by RecordObservableInstruments().

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

Remarks

Напомена

Unlike UpDownCounter which takes the increment/delta value, the callback function reports the absolute value of the ObservableUpDownCounter. To determine the reported rate the ObservableUpDownCounter is changing, the difference between successive measurements is used.

Example uses for ObservableUpDownCounter: the process heap size or the approximate number of items in a lock-free circular buffer.

Applies to

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