-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is start_with_last broken? #340
Comments
Because diff is supposed to work with the last and the first entry of a bucket and I didn't test that feature with the statistics. |
Thanks for your reply.
Isn't that in contradiction with the very purpose of start_with_last? I mean, even if there cannot be any earlier value in the bucket, start_with_last actually adds a value from the previous bucket (as the documentation states). I think that's the behaviour one would always expect when using start_with_last, regardless of whether originally the first value was on the bucket's timestamp or not. |
To illustrate my point, suppose we have a sensor that yields a new, increasing value every 10 minutes (and resets at midnight). 11:40:01 0 With start_with_last set to true, the diff function will show 6 for hour 12 and 4 for hour 13. But now suppose the sensor updates 1 second earlier (at full minutes): 11:40:00 0 Due to timestamp checking, start_with_last will have no effect here - the diff function will show 5 (6-1) for hour 12 and 3 (10-7) for hour 13. I would expect that the sum of hourly diffs will be equal to the daily gain (which is 10 in our example). It's true in the first example, but not in the second one, just because the sensor is just 1 second faster. It seems not justified to me. |
I see your point, thanks. I'll update the behavior! |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Hi, I have created a PR for you. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This issue was closed because it has been stalled for 10 days with no activity. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This issue was closed because it has been stalled for 10 days with no activity. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Still unclosed. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Still unclosed. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This issue was closed because it has been stalled for 10 days with no activity. |
Reopen please. |
This is not working as expected:
It just shows zeros throughout the entire graphspan.
I have debugged the code and the reason is the third IF statement here:
Basically, when retrieving hourly long term statistics, there is only one datapoint in each bucket and the datapoint's timestamp is always equal to the bucket's timestamp.
So the question is: why are the timestamps expected to be different?
The text was updated successfully, but these errors were encountered: