> -----Original Message-----
> ... On Behalf Of Frank Ch. Eigler
> Sent: Saturday, 28 June 2014 11:14 AM
> To: Amer Ather
> Cc: pcp@xxxxxxxxxxx
> Subject: Re: [pcp] pcp grafana and graphite - How to convert pcp metric
> values into percent
> ...
> Actually, hacking not required. libpcp already automagically lets you add
> derived metrics to any pcp client using the $PCP_DERIVED_CONFIG
> environment variable. See man PCPintro(1) & pmLoadDerivedConfig(3).
Correct ... Frank just beat me to responding.
To expand a little ...
Create a file called for example, $HOME/pctavg with these contents:
kernel.pct.cpu.user = 100 * kernel.all.cpu.user / hinv.ncpu
kernel.pct.cpu.nice = 100 * kernel.all.cpu.nice / hinv.ncpu
kernel.pct.cpu.sys = 100 * kernel.all.cpu.sys / hinv.ncpu
kernel.pct.cpu.idle = 100 * kernel.all.cpu.idle / hinv.ncpu
kernel.pct.cpu.intr = 100 * kernel.all.cpu.intr / hinv.ncpu
kernel.pct.cpu.wait.total = 100 * kernel.all.cpu.wait.total / hinv.ncpu
then run pmwebd as
$ PCP_DERIVED_CONFIG=$HOME/pctavg pmwebd ...
and the (derived) metrics kernel.pct.cpu.* will magically become available
for plotting.
|