Repository navigation
Conversation
drpm is the difference between the fan speed and its low limit (fan_min), so it's negative when a fan runs below that limit. sar, "sadf -d" and "sadf -p" display it that way, e.g. -1000.00 for a fan at 1000 rpm with a low limit of 2000 rpm. But the XML and JSON outputs cast it to an unsigned long long, which gives drpm="18446744073709550616" for that fan on x86_64. Print drpm as a signed value there too. The XSD document already defines it as an xs:integer. Add test 01560, which uses a small data file collected with a fake hwmon chip where fan 1 runs below its low limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fan running 1000 rpm below its low limit gets
drpm="18446744073709550616"insadf -xon my x86_64 box, and the same number insadf -j.sar -m FANandsadf -dshow-1000.00for that sample, but the XML and JSON code casts the difference tounsigned long long.I changed both to print it signed, which
xml/sysstat.xsdalready expects sincedrpmis anxs:integerthere. Test 01560 checks the two outputs against a small data file recorded from a fake hwmon chip with a fan under its limit.sadf -lputs the same wrong value in the PCP archive. I didn't touch that because #459 is rewriting those functions.