pcp
[Top] [All Lists]

Re: Confusion about metricConvert() value for kernel.all.cpu.user

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: Confusion about metricConvert() value for kernel.all.cpu.user
From: Rohan Arora <rarora2012@xxxxxxxxx>
Date: Fri, 07 Aug 2015 13:19:00 +0000
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=R6UGhK/ZiP0SdYmcZelNUqlBN3eKLKNrObwTL+HAr/Q=; b=M7F78r3ny/m5voD2HH5ChwVAGF/3GXAKiS7r7DTh3JYP/pwGm4SEC0MZ05641h/ueH gv84PzH/yXeTI1FZJ2Cd7+5h0W1Sl5PHpiY5ruGxDtYB4RSPdH7jcvYBNBTbsT0qsyHV MuWpsh89MfoLQSU4QIzPBnvgXBKOwHZgWd6kji1i/muExjAYdTs57z6cvAHjMLHPqMoN 1DvXd5lqp9MXXJaJVhPByTeka3ssNcna7QGe7RCN9C/ADVCt08r238d/8Gr/IA3D34qv vFSiYninqPeuxvUmK4OeYzS6GGQwU/G0rFjiAa6qC3X/blvhjdQS/E9EibfCIzEzyGqW oDYg==
In-reply-to: <y0mr3nfuu2u.fsf@xxxxxxxx>
References: <CANbxzdVdC91nn8WG8MXNu=LjP32ehO4VAa7tKNVuUONOyJh8uA@xxxxxxxxxxxxxx> <87si7wxjpv.fsf@xxxxxxxxxx> <CANbxzdWJ5FoO72EHZyA9jVJ7us1C6qOshzxcyO9vynayeO01Nw@xxxxxxxxxxxxxx> <y0mr3nfuu2u.fsf@xxxxxxxx>
If I simply do a metricConvert() for kernel.all.cpu.user and then divide the value by 10, I end up with values that are ~30% higher than what top shows me, or it shows 0% when top does not. However, I do get values that are quite close by doing the following:
    float(user) / (user + nice + sys + idle + intr + steal + guest + vuser + total + soft + hard) * 100

Do you know why there might such a difference in the values using the method that you described and top? Also, is the method I mentioned above a valid way to measure the user cpu usage?

Thanks,
Rohan

On Fri, Aug 7, 2015 at 9:06 AM Frank Ch. Eigler <fche@xxxxxxxxxx> wrote:

rarora2012 wrote:

> [...]Â From the above portion of an e-mail, I was under the
> impression that the rate-converted value would come out as a decimal
> directly corresponding to the percentage from a reply from a former
> thread.Â

Rate conversion will take it from a sequence of counter values
(milliseconds) to a rate (milliseconds per second). 1000 of those
would mean 100%, so you need to divide by 10.

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