ObservableUpDownCounter<T> Class
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.
A metrics-observable instrument that reports increasing or decreasing values when the instrument is being observed. Use this instrument to monitor the process heap size or the approximate number of items in a lock-free circular buffer, for example. To create an ObservableUpDownCounter object, use the CreateObservableUpDownCounter methods.
generic <typename T>
where T : value classpublic ref class ObservableUpDownCounter sealed : System::Diagnostics::Metrics::ObservableInstrument<T>
public sealed class ObservableUpDownCounter<T> : System.Diagnostics.Metrics.ObservableInstrument<T> where T : struct
type ObservableUpDownCounter<'T (requires 'T : struct)> = class
inherit ObservableInstrument<'T (requires 'T : struct)>
Public NotInheritable Class ObservableUpDownCounter(Of T)
Inherits ObservableInstrument(Of T)
- T
The type that the counter represents.
- Inheritance
Note
Unlike UpDownCounter
, which takes the increment/delta value, the callback function reports the absolute value of the ObservableUpDownCounter
. To determine the reported rate that the ObservableUpDownCounter
is changing, the difference between successive measurements is used.
This class supports only the following generic parameter types: Byte, Int16, Int32, Int64, Single, Double, and Decimal.
Description |
Gets the instrument description. (Inherited from Instrument) |
Enabled |
Gets a value that indicates if there are any listeners for this instrument. (Inherited from Instrument) |
Is |
Gets a value that indicates if the instrument is an observable instrument. (Inherited from ObservableInstrument<T>) |
Meter |
Gets the Meter that created the instrument. (Inherited from Instrument) |
Name |
Gets the instrument name. (Inherited from Instrument) |
Tags |
Returns the tags associated with the instrument. (Inherited from Instrument) |
Unit |
Gets the instrument unit of measurements. (Inherited from Instrument) |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Observe() |
Fetches the current measurements being tracked by this instrument. All classes extending ObservableInstrument{T} need to implement this method. (Inherited from ObservableInstrument<T>) |
Publish() |
Activates the instrument to start recording measurements and to allow listeners to start listening to such measurements. (Inherited from Instrument) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Product | Versions |
---|---|
.NET | 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: