Buffering Data

Since data from inputs can arrive at different frequencies (e.g. 10 times per second), it's often useful to buffer that data, observe some aspect of the values as a whole (e.g. the mean value), and/or filter the data.

📘

Note

An Observations buffer can be thought of as a queue (FIFO buffer). When the buffer is full, the oldest value is removed from the buffer when a new value arrives in the buffer.

The steps below illustrate how to set up an Observation to buffer 100 input values from the light sensor included with the mangOH Red. The subsequent sections show how to work with the buffered data in different ways and will build off of this configuration:

  1. Navigate to Device > Observations.
  2. Click Add Observation.
  3. Click on Observed Resource and select /redSensor/light/value.
  4. Enter a descriptive name into the Observation name field.
  5. Select one of the options for Send events to, to specify where the observed events will be sent. For information about each of the options see Routing Events from Observations.
  6. Enable Buffer Events.
  7. Enter 100 into Buffer size. This specifies the number of values to hold in the buffer.
  8. Click Save.