APIObservableGauge<T extends num> class
APIObservableGauge is an asynchronous Instrument which reports non-additive value(s) when the instrument is being observed.
An ObservableGauge is intended for capturing values that are not meant to be combined across multiple entities, such as the current temperature, CPU usage percentage, or room occupancy.
Constructors
-
APIObservableGauge.new(String _name, String? _description, String? _unit, bool _enabled, APIMeter _meter, [ObservableCallback<
T> ? callback]) - Creates a new observable gauge instrument
Properties
-
callbacks
→ List<
ObservableCallback< T> > -
Returns the current list of callbacks registered to this instrument.
no setter
- description → String?
-
Returns the description of this observable gauge.
no setter
- enabled → bool
-
Returns whether this observable gauge is enabled.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- meter → APIMeter
-
Returns the meter that created this observable gauge.
no setter
- name → String
-
Returns the name of this observable gauge.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unit → String?
-
Returns the unit of this observable gauge.
no setter
Methods
-
addCallback(
ObservableCallback< T> callback) → APICallbackRegistration<T> - Registers a callback function that will be invoked when the instrument is observed.
-
collect(
) → List< Measurement< num> > - Collects measurements from all registered callbacks. This method is typically only called by the SDK during collection.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeCallback(
ObservableCallback< T> callback) → void - Removes a callback from this instrument.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited