Observations delivery manager

From AMTech WikiDocs
Jump to: navigation, search

Observations delivery manager

For those plugins that use it, it is possible to control the frequency for which the observations are sent. The property observationDeliveryInterval allows to reduce the number of observations sent for a device to only one on each interval. If its value is 0 then the observations are sent immediately when they are produced (observation delivery manager is disabled) and a positive number means that only one of the observations (the last one) produced on each interval will be sent for each device.

When the observations are also smoothed (see Smoothing observations), produced observations means those that have passed the smoothing criteria,

Note: Only the observations with smoothingResults equals to "seen" are filtered. The "new" and "lost" observations are sent immediately

Example: Let us say that we have a plugin with two sensors measuring temperature for which observationDeliveryInterval is set to 5000 (5 second). Let us suppose that the observations are accepted only when the temperature changes. Assuming that the corresponding sensor send a measure every 1 second we could have the following:  
Time (s) sensor id Measure Events
0 1 25 Observation sent with new for device 1

Observation with seen stored for later delivery

0 2 20 Observation sent with new for device 2

Observation with seen stored for later delivery

1 1 25 Observation filtered by smoothing
1 2 25 Observation satisfied smoothing thus replaced the stored for later delivery
2 1 22 Observation replaced the stored for later delivery
2 2 23 Observation replaced the stored for later delivery
3 1 22 Observation filtered by smoothing
3 2 23 Observation filtered by smoothing
4 1 22 Observation filtered by smoothing
4 2 23 Observation filtered by smoothing
5 Observation delivery manager sends the stored observations
-{device: 1, temperature: 22}
-{device: 2, temperature: 23}

Observation delivery manager clear storage