Today flespi containers as a fundamental part of flespi storage system received few new features:
Now it is possible to change container flags with PUT request. Flags are used to specify the strategy for storing duplicate data under same key. New flag - 0x10 can be specified whenever container is expected to contain timeseries data and thus flespi will perform its automatic data generalization.
The rules for data generalization are predefined and not flexible at the moment:
- messages up to 3 days are stored as is
- messages from 3 to 10 days are generalized with 10 minutes interval
- messages from 10 days up to 60 days are generalized with 1 hour period
- messages later than 60 days are generalized with 1 day period
Generalization is done using average method. To experiment with the function you may request for data generalization using built-in GET /storage/containers/XXX/message API call.
At the same moment we have changed generalization call result slightly. Previously it always returned resulting average values as double, e.g. (1 + 2 + 2)/3 == 1.6666. Now it will use same type of number as original value, e.g. (1 + 2 + 2)/3 = 2.
We activated generalization in user statistics and enlarged flespi users statistics storage from 1 to 10 years.