Edit

Share via


ObservableInstrument<T> Class

Definition

ObservableInstrument{T} is the base class from which all metrics observable instruments will inherit.

generic <typename T>
 where T : value classpublic ref class ObservableInstrument abstract : System::Diagnostics::Metrics::Instrument
public abstract class ObservableInstrument<T> : System.Diagnostics.Metrics.Instrument where T : struct
type ObservableInstrument<'T (requires 'T : struct)> = class
    inherit Instrument
Public MustInherit Class ObservableInstrument(Of T)
Inherits Instrument

Type Parameters

T

The type that the observable instrument represents.

Inheritance
ObservableInstrument<T>
Derived

Remarks

This class supports only the following generic parameter types: Byte, Int16, Int32, Int64, Single, Double, and Decimal.

Constructors

ObservableInstrument<T>(Meter, String, String, String)

Initializes a new instance of the ObservableInstrument<T> class using the specified meter, name, description, and unit. All classes that extend ObservableInstrument{T} must call this constructor when constructing objects of the extended class.

ObservableInstrument<T>(Meter, String, String, String, IEnumerable<KeyValuePair<String,Object>>)

Initializes a new instance of the ObservableInstrument<T> class with the specified meter, name, description, and unit.

Properties

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)
IsObservable

Gets a value that indicates if the instrument is an observable instrument.

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)

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

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.

Publish()

Activates the instrument to start recording measurements and to allow listeners to start listening to such measurements.

(Inherited from Instrument)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to