pcp
[Top] [All Lists]

Re: pcp grafana and graphite - How to convert pcp metric values into per

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: pcp grafana and graphite - How to convert pcp metric values into percent
From: Amer Ather <aather@xxxxxxxxxxx>
Date: Wed, 2 Jul 2014 10:57:28 -0700
Cc: pcp@xxxxxxxxxxx, Martin Spier <mspier@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CS2X57KqAFYpFnhY9xjk65NnFLuz6AtEsktb4D5RYmI=; b=Xe5kbj/AKE2OjbPhGRZGYYfKXm/plER0hfrYmBSU48c7sGIg6lsBB3e4yoFTUZ8IcI m17dahwC1JVEHvhTW/5oJkK8w0GRT3KiYs9s4kubOxMVoDjqzK8oGMm47X6T0VGAGz+h uFpaoDRwtSvG+7j8vq+mPYM1A27+GLiaqoY5Q=
In-reply-to: <y0m1tu41lld.fsf@xxxxxxxx>
References: <CAM1aq-HG2oJxCx1EAA0Zr+W7-NsSmVfThb8zG35FOKC4mbbnww@xxxxxxxxxxxxxx> <y0mha353ky5.fsf@xxxxxxxx> <y0m8uoh3kf4.fsf@xxxxxxxx> <002d01cf9284$dc8fe570$95afb050$@internode.on.net> <002f01cf9285$f0c63160$d2529420$@internode.on.net> <CAM1aq-HgP5+Tsq_sCLWH6GrLOn8UXQWaEVkVaC1p=TT_kMn6Tg@xxxxxxxxxxxxxx> <20140629220735.GA13993@xxxxxxxxxx> <CAM1aq-Hr2ss+b82p1EMCRTjK_Vsbnde_tKVv53MQfP25p4e-aw@xxxxxxxxxxxxxx> <y0m1tu41lld.fsf@xxxxxxxx>
Frank and Nathan,

So what I understand that rate conversion does not work for PMWEBAPI client but works fine for pmval and pmwebd graphite extension.Â

I tested it and that is exactly what I am seeing. pmval is doing rate conversion, but curl is returning raw values. That means our UI client has to do rate conversion when using PMWEBAPI call.

$cat pctavg
kernel.pct.cpu.user = 100 * kernel.all.cpu.user / 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.nice = 100 * kernel.all.cpu.nice / 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


PCP_DERIVED_CONFIG=pctavg pmval -f3 -s3 kernel.pct.cpu.user

metric: Â Âkernel.pct.cpu.user
host: Â Â Âkvick-trustyhvm-i-1e814740
semantics: cumulative counter (converting to rate)
units: Â Â millisec (converting to time utilization)
samples: Â 3
interval: Â1.00 sec
       Â40.487
       Â42.235Â

curl.sh:
--------


echo "New Context received from server: $CONTEXT"


# ./curl.sh

New Context received from server: 253643307
{ "timestamp": { "s":1404323698, "us":955081 },
"values": [
{ "pmid":2143289350, "name":"kernel.pct.cpu.idle","instances": [
{"value":1.92329e+11}] },
{ "pmid":2143289349, "name":"kernel.pct.cpu.sys","instances": [
{"value":1.53737e+10}] },
{ "pmid":2143289348, "name":"kernel.pct.cpu.user","instances": [
{"value":1.51585e+10}] }] }

Amer.



On Tue, Jul 1, 2014 at 8:33 PM, Frank Ch. Eigler <fche@xxxxxxxxxx> wrote:
Amer Ather <aather@xxxxxxxxxxx> writes:

> [...] Âgrafana/graphite reports these values from archives correctly
> in percent. ÂHowever, pmapi fetch returns wrong values: [...]

The graphite emulation code in pmwebd performs rate conversion (since
it has easy historical data to go from); the PMWEBAPI part passes raw
metric values (and libpcp doesn't want to rate-convert [1]). ÂThis
could explain the mismatch between your expectations and what you're
seeing.

[1] http://oss.sgi.com/archives/pcp/2014-05/msg00104.html

- FChE



--
Thanks,

Amer Ather
Cloud Performance Engineering
<Prev in Thread] Current Thread [Next in Thread>