samplingConfiguration property

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

Implementation

SamplingConfiguration? get samplingConfiguration =>
    measure?.overrideSamplingConfiguration ??
    deployment
        ?.deviceConfiguration.defaultSamplingConfiguration?[measure?.type] ??
    deployment?.deviceConfiguration.dataTypeSamplingSchemes?[measure?.type]
        ?.defaultSamplingConfiguration ??
    SamplingPackageRegistry()
        .samplingSchemes[measure?.type]
        ?.defaultSamplingConfiguration;