Red Hat Bugzilla – Bug 1132429
pmdumptext uses wrong host
Last modified: 2017-08-23 11:07:56 EDT
Description of problem: When host is not defined one would expect it being the localhost. localhost:~> pmdumptext -i -l 'rhel-6-server:mem.util.used' 'mem.util.used' Source rhel-6 rhel-6 Thu Aug 21 13:51:41 0.45G 0.45G ^C localhost:~> pmdumptext -i -l 'rhel-6-server:mem.util.used' 'localhost:mem.util.used' Source rhel-6 localh Thu Aug 21 13:51:45 0.45G 5.54G ^C localhost:~> Version-Release number of selected component (if applicable): 3.9.9
To be clear, the problem here appears to be that the "default" context is being redefined by the first metricspec (rhel-6-server:mem.util.used) to be rhel-6-server, rather than localhost. This mirrors the behaviour of -h, e.g. pmdumptext -h rhel-6-server some.metric mem.util.used would report mem.util.used from rhel-6-server not localhost. I am not sure of the correct behaviour here (although the status quo does not follow the law of least surprise) and there are no other command-line tools that allow metricspecs and more than one source of metrics.
> ... (although the status quo does not follow the law of least surprise) and > there are no other command-line tools that allow metricspecs and more than > one source of metrics. I agree - this seems wrong, and looks like it will have several unexpected side-effects. It looks like the way the traverse() function overwrites some globals (doMetricType, doMetricSource, doMetricScale) is the root cause - making these locals within traverse() might go a long way toward fixing this.
Actually, I incorrectly thought pmdumptext could work with more than one host at once, but it turns out it cannot (creates only one QmcGroup object, and has code early on that attempts to guard against multiple hosts - but misses the case where more than one host can come in via use of metricspecs). I guess we need to add more cases to ensure additional hosts/archives are not passed in this way?