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
-
- Object
- AbstractExecutor<
Measure> - Probe
- MeasurementProbe
- BufferingPeriodicProbe
Constructors
BufferingPeriodicProbe
Properties
samplingConfiguration
The sampling configuration for this probe.
Configuration is obtained in the following order:
- from the Measure.overrideSamplingConfiguration
- from the DeviceConfiguration.defaultSamplingConfiguration of the deployment
- from the DeviceConfiguration.dataTypeSamplingSchemes of the static device configuration
- from the SamplingPackage.samplingSchemes of the sampling packages
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
The timer that starts each sampling window.
Methods
getMeasurement
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
Called by pause. Returns true if successfully paused.
If false, the state is not changed.
onResume
Called by resume. Returns true if successfully resumed.
If false, the executor moves to ExecutorState.PausedButShouldBeResumed.
onSamplingEnd
Handler called when sampling period ends.
onSamplingStart
Handler called when sampling period starts.