Red Hat Bugzilla – Bug 1242463
RFE: provide a method to query set of metrics with aliases
Last modified: 2015-12-17 04:11:16 EST
Description of problem: When running an application with somewhat known behaviour patterns it is sometimes a known set of performance metrics that are of interest. Just to give an example, these "interesting" metrics could include certain metrics from kernel, mem, disk, network, nfs, and a (custom) PMDA. While there are many recent PCP utilities (pmstat, pmiostat, pmcollect, pmatop) which greatly help inspecting general system level behaviour no tool currently allows a quick display of such a set of predefined metrics. pmdumptext could be perhaps used but typing more than few metric names quickly becomes tedious. So either a wrapper for it or a separate API using script would be needed. It would be nice if PCP would allow one to use "aliases" to define a set of metrics that merely requesting statistics for an alias would display all the associated metrics. I realize this might require quite a lot of work to implement (and might be more natural to do so in wrapper scripts) but OTOH it would provide lots of flexibility e.g. for support personnel working under pressure to solve issues in production systems where applications are known and using "aliases" would be much easier than typing dozens of metrics manually. This is obviously about command line only, on GUI/WebUI side this is already possible.
I thought a bit more about this and actually this should be pretty simple to implement after all. Initially I was thinking about extending pmdumptext or such but that'd be cumbersome, using the Python PMAPI allows quickly writing this kind of tool and then it's mostly a question of how to allow the user to define metric sets to display. For example, the following kind configuration file might be suitable (which values would be used unless not overridden on command line): # PCP options [options] interval=2sec #host= #archive= #derived_commands_conf=/some/path # These metrics are displayed as part of any set [global] metrics = kernel.uname.nodename # These metrics are display if no metric set is defined [default] metrics = kernel.all.uptime # Custom set [myapp1] metrics = kernel.all.cpu.wait.total, disk # Custom set [myapp2] ... Thanks.
(In reply to Marko Myllynen from comment #1) > [...] > using the Python PMAPI allows quickly writing > this kind of tool and then it's mostly a question of how to allow the user > to define metric sets to display. Yep, I like your ideas here. > For example, the following kind configuration file might be suitable (which > values would be used unless not overridden on command line): Might find the pcp2graphite code to be a good starting point for a tool like this Marko (if you want to hack on it)? It has similar sorts of problems to solve to get to the point of sending metrics to the graphite port (whereas, in your case you'd want to do similar setup, then print metrics to stdout). Personally, I prefer your config file approach to the command line approach that pcp2graphite currently employs - but each to their own. Perhaps some sharing of code/ideas could be done here, allowing both tools to have either config file or command line argument models of metric specification. cheers.
This is now part of 3.10.9 in the form of pmrep: http://oss.sgi.com/pipermail/pcp/2015-September/008332.html https://www.mankier.com/1/pmrep