Skip to content

BufferingPeriodicProbe

A probe that collects data in sampling windows, one measurement per window.

Uses a PeriodicSamplingConfiguration: every PeriodicSamplingConfiguration.interval it calls onSamplingStart, and after PeriodicSamplingConfiguration.duration it calls onSamplingEnd and adds the result of getMeasurement. On pause, any buffered data is collected with getMeasurement too.

Inheritance

Constructors

BufferingPeriodicProbe

BufferingPeriodicProbe()

Properties

samplingConfiguration

PeriodicSamplingConfiguration? 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.

timer

Timer? timer
getter/setter pair

The timer that starts each sampling window.

Methods

getMeasurement

Future<Measurement?> getMeasurement()
override

Returns the Measurement for the last sampling window.

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.

onSamplingEnd

void onSamplingEnd()

Handler called when sampling period ends.

onSamplingStart

void onSamplingStart()

Handler called when sampling period starts.