pcp
[Top] [All Lists]

RE: [pcp] pcp grafana and graphite - How to convert pcp metric values in

To: "'Frank Ch. Eigler'" <fche@xxxxxxxxxx>, "'Amer Ather'" <aather@xxxxxxxxxxx>
Subject: RE: [pcp] pcp grafana and graphite - How to convert pcp metric values into percent
From: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Date: Sat, 28 Jun 2014 13:55:51 +1000
Cc: <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0m8uoh3kf4.fsf@xxxxxxxx>
References: <CAM1aq-HG2oJxCx1EAA0Zr+W7-NsSmVfThb8zG35FOKC4mbbnww@xxxxxxxxxxxxxx> <y0mha353ky5.fsf@xxxxxxxx> <y0m8uoh3kf4.fsf@xxxxxxxx>
Thread-index: AQGe8/z7D4wvNEEjUhHbOmDpyVH2UwMFu+SsAbarouibwT0C0A==
> -----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.


<Prev in Thread] Current Thread [Next in Thread>