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

CA-404591 - rrd: Do not lose precision when converting floats to strings #6238

Merged

Conversation

last-genius
Copy link
Contributor

lastupdate field in the XML RRD blob file, in particular, was getting truncated floats representing the number of seconds, which loses A LOT of precision, meaning RRDs could not be checked to have been produced with the 5-second frequency.

lastupdate field in the XML RRD blob file, in particular, was getting truncated
floats representing the number of seconds, which loses A LOT of precision,
meaning RRDs could not be checked to have been produced with the 5-second
frequency.

Signed-off-by: Andrii Sultanov <[email protected]>
@last-genius
Copy link
Contributor Author

This, together with an update to xenrt code, passed the faulty test (4198186)

@last-genius
Copy link
Contributor Author

On the other hand, this change makes the /var/xapi/blobs/rrds/ files significantly bigger. I don't think this should impact anything critical - but can run more tests if there are worries.

Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

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

That's the format we're stuck with, os we can't relaly avoid getting bigger.

Copy link
Contributor

@edwintorok edwintorok left a comment

Choose a reason for hiding this comment

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

In some cases 16g or 17g might be needed, but we don't deal with values quite so precise in RRDs.
15g is probably a good compromise: 17g would make the output even bigger unnecessarily.
A more compact form might be to use '%h' and this would fully preserve all the bits in the float, but it wouldn't be compatible with JSON.

@edwintorok edwintorok added this pull request to the merge queue Jan 17, 2025
Merged via the queue into xapi-project:master with commit 1e5114c Jan 17, 2025
15 checks passed
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.

5 participants