Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
pmval does not print negative values #67
Comments
|
Bit more info... | nathans: Rares, ooc, what are you measuring that you're expecting to go negative? |
|
OK ... in 21 years this is the first time I've ever seen a PMDA that exports a negative value for an instantaneous metric ... nothing wrong with that, just outside the design envelope (and hence out of mind). I would suspect that a lot more than pmval would be broken by this ... we'll need to extend the sample PMDA, then audit all the tools. But I do not expect the scope of the changes to be large (once you've addressed all 4 PM_TYPE_*s that could be used to hold a negative value). Thanks, Rares. |
|
Temperature ... that's a blast from the past! |
|
But as Frank has pointed out there is already at least one metric with instantaneous semantics and often negative value ... swapdev.priority [swap resource priority] Now the Units are wrong (I'll fix that), but otherwise similar ... but interestingly kenj@bozo:~$ pmval swapdev.priority metric: swapdev.priority /dev/sda7 works ... so this may be as small as a corner case in the handling of non-integer values in pmval, as Rares originally suggested. |
|
As expected, this required a small number of relatively localized code changes ... the bulk of the PMAPI code paths work just fine with negative metric values. |
rvernica commentedFeb 9, 2016
I modified the
acme.cexample provided in the Programmer's Guide and here do generate negative numbers.When reading the values produced,
pminfodisplays the values correctly butpmvalprints!in place of the negative values.This might be the location in
pmvalwhere this might need to be fixed pmval.c#L505You can see here the changes made to
acme.cto print negative numbers.