| To: | Nathan Scott <nathans@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [pcp] Fetch User CPU Usage as a Percentage? |
| From: | Rohan Arora <rarora2012@xxxxxxxxx> |
| Date: | Wed, 05 Aug 2015 17:13:28 +0000 |
| Cc: | Lukas Berk <lberk@xxxxxxxxxx>, 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=kEn2mcqOmVb331mcntxEIpLwlIi/BvTQZnbSteG1zTo=; b=DX/viTOfq8WgsvJelX8cZedOileNo7GKXsVsFtccVUr03dQjX/f4D9FCHaxEk9BcM8 hL61nyEScHCAgYty8PrZ3+2i93L535f408sTwTGMVAanKbvKo034B6d2diWKK3yFoqe6 cx5eu7fHECNMWF30/XgQ/fRnqifK4z1FjnroL6SNE4PLv8q/7bHo52TTVnxa5291LX7L v/b81GcX9glrP/exXswsvCk42W/RBxhyHsmekk50QHJuXbVCUSInQNZMH6f6zF4YHIlC 224h3YmvEPMv1W77GrVFcHah7pyY+XNf7jPM6Xa4MEkaUMJADiAHcENMaiKEQ/SVGFwj m30A== |
| In-reply-to: | <CANbxzdVGc8i_9-z29Bb8dq+5VekS4KVCHX9jDBNdgc6=nZYPMQ@xxxxxxxxxxxxxx> |
| References: | <CANbxzdXXmYefH5B1in5zYSkAT8gOieN387sNXDTvTR=9gyUNOw@xxxxxxxxxxxxxx> <87egjp3ffv.fsf@xxxxxxxxxx> <CANbxzdXrhBZO1fOKU+31a+mpTq1JDiNuhXO=QUEkyeKypD-aZg@xxxxxxxxxxxxxx> <CANbxzdWJPJwB0FtAnBtRe--XWKmaK4c9h5vJAhAZzF=GmUf3Hw@xxxxxxxxxxxxxx> <CANbxzdUaNPg6NV28OdAj+iOUNPBSb3mmvjOdUgrE8KFRCj8rqQ@xxxxxxxxxxxxxx> <CANbxzdXSZE3WrAOn5LXjdK1DZsevERMZ8xBo-KRMe1GPPxk-uw@xxxxxxxxxxxxxx> <1899659656.1423571.1438300850093.JavaMail.zimbra@xxxxxxxxxx> <CANbxzdVd42n9nVZuGajmdRq3PPcU=8=cS8VMxTk==mw4QycfHA@xxxxxxxxxxxxxx> <849907258.4457090.1438733991270.JavaMail.zimbra@xxxxxxxxxx> <CANbxzdVGc8i_9-z29Bb8dq+5VekS4KVCHX9jDBNdgc6=nZYPMQ@xxxxxxxxxxxxxx> |
|
So, I have kind of got something working running the following code: Â Â metrics = ( Â Â Â Â"mem.physmem", Â Â Â Â"mem.util.used", Â Â Â Â"kernel.all.cpu.user" Â Â ) Â Â m_group = pmcc.MetricGroup(pmcc.MetricCache(PM_CONTEXT_HOST, "hostname")) Â Â m_group.mgAdd(metrics) Â Â m_group.mgFetch() Â Â sleep(1) Â Â m_group.mgFetch() Â Â print m_group["kernel.all.cpu.user"].metricConvert(m_group.mgDelta()) And I get the following as a result: Â ÂÂ[(<pcp.pmapi.pmValue object at 0x27d8c20>, '', 308.4132647893692)] I have a couple of questions about what the result of calling metricConvert() gives me. The second value is supposed to be the name, which in this case should be "kernel.all.cpu.user" correct? Also, what are the units for the last value? I see in the code that it is (value - pvalue) / delta but what does that number tell me? What do I do to that number to turn it into a percentage? Thanks, Rohan On Wed, Aug 5, 2015 at 9:30 AM Rohan Arora <rarora2012@xxxxxxxxx> wrote:
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [pcp] Fetch User CPU Usage as a Percentage?, Rohan Arora |
|---|---|
| Next by Date: | Re: [pcp] qa/730 failing on ia64/SLES11, Nathan Scott |
| Previous by Thread: | Re: [pcp] Fetch User CPU Usage as a Percentage?, Rohan Arora |
| Next by Thread: | qa/730 failing on ia64/SLES11, Ken McDonell |
| Indexes: | [Date] [Thread] [Top] [All Lists] |