pcp
[Top] [All Lists]

Re: per cpu utilisation from archive - pmval

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: per cpu utilisation from archive - pmval
From: Allan McAleavy <allan.mcaleavy@xxxxxxxxx>
Date: Tue, 17 May 2016 16:21:54 +0100
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hJSq5+75vXd+StKDXyKkI35RLCRn6NR7agkSW1hqg1k=; b=TYQLbbN1lH81HnXa9sH9T8ZQnmCJebiESqkHCAUo8W9rM85lu63FzlhsyrVG4qNycy xtmCmdRTALvImBuPCAnz3oVwqF6IeT8ReanLza6a4LzwgKmo1APzjIACtYij7mUsgKU3 96aAmvKKxAzZbSLGsgOT3EWFE26UP4ZdIi2D6+if0WamIfzLJTeSK4XwfBMQl6StI4bY kfw9wyUkymhNEwiGg7Hy/pmadKtzvccle44zqOR1UQkGzDCD4hyKaPsiT8HUjtJUzPpo QHpO8cX6RqQeLI3VW8rEFMIgIlt+hBavXPFYkTD+CrcAzovIuGutt5CR1bfr9N3P4Yiu 23pw==
In-reply-to: <20160517145609.GB28299@xxxxxxxxxx>
References: <CAF6XsOcfikRQ-EJ9cM+iuHhpHEinvKaKDWm3oB27gMPwF2vcOw@xxxxxxxxxxxxxx> <y0moa84refi.fsf@xxxxxxxx> <CAF6XsOdDyKm_9MzfFt+GFLkvUFg4VQ2-kcjhtwQywQcM0Z09fQ@xxxxxxxxxxxxxx> <20160517145609.GB28299@xxxxxxxxxx>
Hi Frank

the pmval was launched as follows as was my test.

PCP_DERIVED_CONFIG=/var/tmp/user_pct pmval -f3 kernel.pct.cpu.user -s 30 > /var/tmp/pmval.log & Âmpstat -P ALL 1 30 > /var/tmp/mpstat.log & sleep 5 ; stress -c 12 --timeout 5


Âcat /var/tmp/user_pct
kernel.pct.cpu.user = 100 * kernel.percpu.cpu.user

Thanks
Al

On Tue, May 17, 2016 at 3:56 PM, Frank Ch. Eigler <fche@xxxxxxxxxx> wrote:
Hi -

On Tue, May 17, 2016 at 03:35:43PM +0100, Allan McAleavy wrote:
> [...]
> Looking at the archive the data is available. I am looking to gather per
> CPU utilisation from the archive.
>
> pminfo -fa 20160517.12.00.0 |grep kernel.percpu.
> [...]
> kernel.percpu.cpu.user
> [...]

OK.

> I can run a test using stress, below shows the mpstat data
> [...]
> 15:16:27Â Â Â 15Â Â 0.99Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00Â Â 0.00
>Â 0.00Â Â99.01
> [...]

OK.

> And the pmval data
> interval:Â 1.00 sec
>
>Â Â Âcpu0Â Â Âcpu1Â Â Âcpu2Â Â Âcpu3Â Â Âcpu4Â Â Âcpu5Â Â Âcpu6Â Â Âcpu7
> cpu8Â Â Âcpu9Â Â cpu10Â Â cpu11Â Â cpu12Â Â cpu13Â Â cpu14Â Â cpu15
> [...]
>Â Â98.845Â Â98.845Â Â 0.000Â Â98.845Â Â98.845Â Â 0.000Â Â98.845Â Â 0.000
> 98.845Â Â 0.000Â Â98.845Â Â97.847Â Â98.845Â Â98.845Â Â98.845Â Â98.845

But how exactly was pmval invoked for that output?


> pmval -f 3 -a 20160517.12.00.0 -S@15:16:21 -T@15:16:27
> kernel.percpu.cpu.user[cpu15]
> units:Â Â Âmillisec (converting to time utilization)
> [...]
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âcpu15
> [...]
> 15:16:27.000Â Â Â Â Â Â Â Â 0.075

OK, that matches what I see here.

But AFAIK, pmval doesn't behave differently based on whether its input
data source is an archive vs. live, in terms of metric value scaling
or computation.


> I had thought that it would be similar to mpstat where we take the say
> cpu.user(cur) - cpu.user(pre) / (sum of all cpu cur) - (sum of all cpu
> prev) * 100.

(No. Such rescaling would be done by another layer of code, perhaps
derived-metrics in libpcp, or a specialized tool such as pmcollectl.)


- FChE

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