measurements property

Stream<Measurement> get measurements

The stream of all sampled measurements.

Data in the measurements stream are transformed in the following order:

  1. privacy schema as specified in the privacySchemaName
  2. preferred data format as specified by dataFormat in the SmartphoneDeployment.dataEndPoint
  3. any custom transformer provided in the configure method when configuring this controller

This is a broadcast stream and supports multiple subscribers.

Implementation

Stream<Measurement> get measurements =>
    _executor.measurements.distinct().map((measurement) => measurement
      ..data = _transformer(DataTransformerSchemaRegistry()
          .lookup(deployment?.dataEndPoint?.dataFormat ?? NameSpace.CARP)!
          .transform(DataTransformerSchemaRegistry()
              .lookup(privacySchemaName)!
              .transform(measurement.data))));