Closed Nocccer closed 7 months ago
Related tickets:
Thank you for your contribution! There is a community owned fork of Flux that would be a great place to open this PR. More context:
We are still supporting Flux, but are not doing active development on it or adding any new features to it. We still do security patches and will address any critical defects through the maintenance period. Our focus now is on features related to our latest database engine, InfluxDB 3.0, and its associated products (Cloud Serverless, Cloud Dedicated, Clustered, Edge).
I would argue that this is a critical defect with the integral function...
Description
The current integral function with interpolate is not working if points are in between the time range. The first point and the last point are wrong calculated. This is a big problem in the IoT world where devices send data based on events and not in a defined time interval. Even if they send it in an interval, this time is mostly not realtime, so timestamp have some time difference to the actual configured interval.
Lets asume we have two points:
And a time Range:
With the current
integral
andinterpolate: true
this leads to false calculations especially if you use thetimeWeightedAvg
which is based onintegral
.By stretching the first point to the start of the time range and the last point to the stop of the time range, we get a more precized integral:
With
interpolate:false
we get the following:This PR adds this solution to the integral function.
Open Discussion:
timeWeigthedAvg
to work.Checklist
Dear Author :wave:, the following checks should be completed (or explicitly dismissed) before merging.
experimental/
docs/Spec.md
has been updatedDear Reviewer(s) :wave:, you are responsible (among others) for ensuring the completeness and quality of the above before approval.