Skip to content
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

WIP: naive attempt at fixing average aggregation breaking deduplication #501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

r00t-
Copy link
Contributor

@r00t- r00t- commented Oct 2, 2021

naive and likely incorrect attempt at fixing average aggregation breaking deduplication

attempting to fix #500

@@ -213,7 +213,7 @@ json_object *vz::api::Volkszaehler::api_json_tuples(Buffer::Ptr buf) {
// a) timestamp
// b) duplicate value
if ((timestamp >= (_last_timestamp + duplicates_ms)) ||
(r.value() != _lastReadingSent->value())) {
(fabs(r.value() - _lastReadingSent->value()) > 0.000001 )) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the tolerance for the comparison (0.000...01) needs to be chosen in relation to the input values, for this to work with numbers in any range,
but my short research did not lead to a best-practice algorithm to use.
(probably needs a float number with it's exponent derived from the exponent of the inputs.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r00t- r00t- force-pushed the fix_avg_aggregation_breaking_deduplication branch 3 times, most recently from e4a2b2c to d523173 Compare January 16, 2023 19:33
@r00t- r00t- force-pushed the fix_avg_aggregation_breaking_deduplication branch from d523173 to 72903cb Compare January 24, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duplicates ignored when using aggmode
2 participants