BufferingPeriodicStreamProbe class

An abstract probe which can be used to sample data from a buffering stream, every frequency for a period of duration. These events are buffered, and once collected for the duration, are collected from the getDataPoint method and send to the main data stream.

Sub-classes must implement the

Stream<dynamic> get bufferingStream => ...

method in order to provide the stream to be buffered.

When sampling starts, the onSamplingStart handle is called. When the sampling window ends, the onSamplingEnd handle is called.

See LightProbe for an example.

Inheritance
Implementers

Constructors

BufferingPeriodicStreamProbe()

Properties

bufferingStream Stream
The stream of events to be buffered. Must be specified by sub-classes.
read-only
controller StreamController<Datum>
read / write, inherited
data Stream<DataPoint>
The stream of DataPoint generated from this probe.
read-only, inherited
duration Duration
read / write, inherited
enabled bool
Is this probe enabled, i.e. available for collection of data using the resume method.
read-only, inherited
frequency Duration
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
measure Measure
The Measure that configures this probe.
read-only, inherited
name String
A printer-friendly name for this probe.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state ProbeState
The runtime state of this probe.
read-only, inherited
stateEvents Stream<ProbeState>
The runtime state changes of this probe. [...]
read-only, inherited
stream Stream<Datum>
The stream for this StreamProbe. Must be implemented by sub-classes.
read-only, override
subscription StreamSubscription
read / write, inherited
timer Timer
read / write, inherited
type String
The type of this probe according to String.
read-only, inherited

Methods

error() → void
inherited
getDatum() Future<Datum>
Subclasses should implement / override this method to collect the Datum. This method will be called every time data has been buffered for a duration and should return the final Datum for the buffered data.
hasChanged(Measure measure) → void
Callback when this probe's measure has changed.
inherited
initialize(Measure measure) → void
Initialize the probe before starting it. [...]
inherited
mark() → void
Mark the latest sampling
@protected, inherited
marking() → void
Get the latest mark
@protected, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onData(Datum datum) → void
inherited
onDone() → void
inherited
onError(dynamic error) → void
inherited
onInitialize(Measure measure) → void
Callback for initialization of probe. [...]
override
onPause() Future
Callback for pausing probe
override
onRestart() Future
Callback for restarting probe
inherited
onResume() Future
Callback for resuming probe
override
onSamplingData(dynamic event) → void
Handler for handling onData events from the buffering stream.
onSamplingEnd() → void
Handler called when sampling period ends.
onSamplingStart() → void
Handler called when sampling period starts.
onStop() Future
Callback for stopping probe
inherited
pause() → void
Pause the probe. The probe is paused until resume or restart is called.
inherited
restart() → void
Restart the probe. [...]
inherited
resume() → void
Resume the probe.
inherited
stop() → void
Stop the probe. Once a probe is stopped, it cannot be started again. If you need to restart a probe, use the restart or pause and resume methods.
inherited
toString() String
A string representation of this object. [...]
inherited
validNextState(ProbeState nextState) bool
Is ProbeState a valid next state for this probe? [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited