Skip to content

BufferingIntervalStreamProbe

A probe that buffers a bufferingStream and emits one measurement per interval.

The interval is IntervalSamplingConfiguration.interval. Subclasses implement bufferingStream, onSamplingData (called per event) and getMeasurement (called per interval).

Unlike BufferingPeriodicStreamProbe, it listens to bufferingStream all the time while resumed, not only in sampling windows.

Inheritance

Constructors

BufferingIntervalStreamProbe

BufferingIntervalStreamProbe()

Properties

bufferingStream

Stream get bufferingStream

The stream of events to buffer. Implemented by subclasses.

samplingConfiguration

IntervalSamplingConfiguration? get samplingConfiguration
override

The sampling configuration for this probe.

Configuration is obtained in the following order:

Returns null in case no configuration is found.

See also the section on Sampling schemes and configurations in the CARP Core Framework. In addition to CARP Core, CARP Mobile Sensing also supports sampling schemes in the sampling packages, which are used as the 4th possible configuration in the list above.

Methods

getMeasurement

Future<Measurement?> getMeasurement()

Returns the Measurement for the data buffered since the last call. Called every interval. Implemented by subclasses.

Can return null if no data is available. Can return an Error if an error occurs.

onPause

Future<bool> onPause()
override

Called by pause. Returns true if successfully paused.

If false, the state is not changed.

onResume

Future<bool> onResume()
override

Called by resume. Returns true if successfully resumed.

If false, the executor moves to ExecutorState.PausedButShouldBeResumed.

onSamplingData

void onSamplingData(
  1. dynamic event
)

Called for each event on bufferingStream; buffers it.