Instrument<T> Class

Definition

The base class for all non-observable instruments.

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

Type Parameters

T

The type that the instrument represents.

Inheritance
Instrument<T>
Derived

Remarks

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

Constructors

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

Create the metrics instrument using the properties meter, name, description, and unit. All classes extending Instrument{T} need to call this constructor when constructing object of the extended class.

Properties

Description

Gets the instrument description.

(Inherited from Instrument)
Enabled

Checks if there is any listeners for this instrument.

(Inherited from Instrument)
IsObservable

A property tells if the instrument is an observable instrument.

(Inherited from Instrument)
Meter

Gets the Meter which created the instrument.

(Inherited from Instrument)
Name

Gets the instrument name.

(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)
Publish()

Publish is activating the instrument to start recording measurements and to allow listeners to start listening to such measurements.

(Inherited from Instrument)
RecordMeasurement(T)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

RecordMeasurement(T, KeyValuePair<String,Object>)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

RecordMeasurement(T, KeyValuePair<String,Object>, KeyValuePair<String,Object>)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

RecordMeasurement(T, KeyValuePair<String,Object>, KeyValuePair<String,Object>, KeyValuePair<String,Object>)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

RecordMeasurement(T, ReadOnlySpan<KeyValuePair<String,Object>>)

Record the measurement by notifying all MeterListener objects which listening to this instrument.

RecordMeasurement(T, TagList)

Records a measurement by notifying all MeterListener objects that are listening to this instrument.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to