Hi @phildunlap, thanks for the info, however I think this way of calculating deltas is flawed for anyone doing metered readings. These happen at regular intervals like above and currently the delta value for an hour does not show the user their usage for one hour and this is the critical issue.
The way the delta is being calculated effectively drops one reading per rollup period and gives a misleading result. The normal approach for metered data at regular intervals is to only allow rollups that are a multiple of the reading interval and to calculate the delta based on the difference between the first reading of each rollup period i.e. for 15 minute readings, an hourly rollup would take the first reading of hour 2 and subtract the first reading of hour 1.
Ofsetting by 1 ms does not cure the problem as it forces the last reading in the period into the next period so it still gets missed.
One solution might be to add a "consumption" delta option to use this method? We're trying to push Mango to our customers right now for energy monitoring and this is the behaviour they need and expect. Similarly, would you consider adding a
last_value-first value to the mango statistics object? Again, for energy monitoring, this delta is the key piece of information as it's their usage in the time period.