pcp
[Top] [All Lists]

Fetch User CPU Usage as a Percentage?

To: "pcp@xxxxxxxxxxx" <pcp@xxxxxxxxxxx>
Subject: Fetch User CPU Usage as a Percentage?
From: Rohan Arora <rarora2012@xxxxxxxxx>
Date: Wed, 29 Jul 2015 15:03:32 +0000
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=P8OTMa3crqelP/Qt2yGL9U+XowMEhN1M79dV57RpIx0=; b=Ld3DfRIwScHwQpBUpCVukMFQKttEzm1I+Mn2Ln+PqbxTxNFEZy2E69HIPVy4OSA6My kT+cU3ezkvRA5pt29J7mHCY3X4WXH+NfB4inurN306m/3RZFBR6YvJNyAyjXRUTFR5pW f6XpXaEXZcKVru7zRIUDVzKSLnPkut7PzabTmdxw1YNPO73OAXVIL6wO5FPXG7fdiJFX TJYXHibe0V0GmhSU+jbStSltbGSECIsFEKY8oF0P8jv5xwgXC37hC4Uc5I1sk+GMxwOu P/5QBR8Myml1YvPdkQp9EaawvCTnWOJlGZZkpkObZPVEAte/o3+0+5NwD1MY/IARRV9J dvfQ==
Is there a way to fetch the User CPU Usage as a Percentage directly, having PCP take more than one sample, and doing the rate-conversion itself using the Python API? Currently what I am doing is running pmFetch twice for the "kernel.all.cpu.user". I then calculate the percentage using (val2 - val1) / (timestamp2 - timestamp1) * 100. Is there a way that I can just have PCP do this automatically? This would also be really nice for working with an archive, as I wouldn't have to do this for each and every result that I get.

If there is not a way to get the percentage directly, is there a better way of going about doing this?

Thanks,
Rohan
<Prev in Thread] Current Thread [Next in Thread>