This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1132429 - pmdumptext uses wrong host
pmdumptext uses wrong host
Status: NEW
Product: Fedora EPEL
Classification: Fedora
Component: pcp (Show other bugs)
el6
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: pcp-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-21 06:53 EDT by Marko Myllynen
Modified: 2017-08-23 11:07 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marko Myllynen 2014-08-21 06:53:09 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
Comment 1 Ken McDonell 2014-08-22 19:09:15 EDT
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.
Comment 2 Nathan Scott 2014-08-24 23:52:16 EDT
> ... (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.
Comment 3 Nathan Scott 2014-08-24 23:59:48 EDT
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?

Note You need to log in before you can comment on or make changes to this bug.