APIObservableCounter<T extends num> class
APIObservableCounter is an asynchronous Instrument which reports monotonically increasing value(s) when the instrument is being observed.
An ObservableCounter is intended for capturing values that can only increase, such as the system uptime, the number of total bytes received, or the number of page faults.
Constructors
-
APIObservableCounter.new(String _name, String? _description, String? _unit, bool _enabled, APIMeter _meter, ObservableCallback<
T> ? callback) - Creates a new observable counter 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 counter.
no setter
- enabled → bool
-
Returns whether this observable counter is enabled.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- meter → APIMeter
-
Returns the meter that created this observable counter.
no setter
- name → String
-
Returns the name of this observable counter.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unit → String?
-
Returns the unit of this observable counter.
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