pcp
[Top] [All Lists]

Re: [pcp] Calculated/derived metrics?

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, pcp@xxxxxxxxxxx
Subject: Re: [pcp] Calculated/derived metrics?
From: Martins Innus <minnus@xxxxxxxxxxx>
Date: Thu, 14 May 2015 15:54:35 -0400
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <554D01FD.4060000@xxxxxxxxxxx>
References: <5534C680.2020709@xxxxxxxxxx> <493537984.3276058.1429528962326.JavaMail.zimbra@xxxxxxxxxx> <5534EBA8.4030509@xxxxxxxxxx> <1644393599.3651017.1429563442835.JavaMail.zimbra@xxxxxxxxxx> <55364606.1000503@xxxxxxxxxx> <55472B40.7050800@xxxxxxxxxx> <5547DE11.5050800@xxxxxxxxxxxxxxxx> <5549E4CD.5000408@xxxxxxxxxx> <554AFE4E.80000@xxxxxxxxxxxxxxxx> <554B3E8F.3080904@xxxxxxxxxx> <554C1F23.1090609@xxxxxxxxxxxxxxxx> <554D01FD.4060000@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


On 5/8/2015 2:35 PM, Martins Innus wrote:
Ken,

On 5/7/15 10:27 PM, Ken McDonell wrote:


But unfortunately in this case the PMDA implementor says the metrics are seconds, but they are not (see the example below) ... this is a BUG .. the PMDA should return hotproc.psinfo.start_time either /100 and call it seconds or *10 and call it msec (and increase it to 64-bits in this case).

# pminfo -f proc.psinfo.start_time | sed -e 's/.* value //' | sort -nr | head -2 ; pminfo -f kernel.all.uptime
9086825
9086825

kernel.all.uptime
    value 90868

So I started looking into this. Looks like this has been there forever (hotproc just uses the same semantics defined in proc). But I have added other proc metrics that may need fixing as well.

While the change for this metric (to ms and 64 bit to match the rest of the "time" metrics in proc) seems correct and straightforward, I have some confusion on the types in general for some of the proc time metrics.

....Lots of text cut....

So I had a first crack at changing some of this. Maybe in practice it doesn't really matter? In any event, needs a look over by someone who understands the history of the KERNEL_ULONG type. Not sure if it needs to be used in more, or in fewer cases in this pmda.


https://github.com/ubccr/pcp/tree/martins_working


The few metrics that were defined as KERNEL_ULONG, I tried to get rid of the explicit uint32 casts.

Also confirmed that the time metrics were 64bit msec in the cases where I though they should be. This changes the type of the following metrics:

proc.psinfo.start_time
proc.psinfo.delayacct_blkio_time
proc.psinfo.guest_time
proc.psinfo.cguest_time

Passes some initial QA runs on 64bit. Will continue testing if this looks reasonable.

At least the proc.psinfo.start_time type is currently incorrect, and something should be done there if the rest is not necessary.

Thanks

Martins


commit 08c4660380dd94e9a6f81065d8f9e85dd5e4c1ff
Author: Martins Innus <minnus@xxxxxxxxxxx>
Date:   Thu May 14 19:39:32 2015 +0000

    Fixup some of the time types in linux_proc

    Some metrics were reporting as seconds when they were not.  Fix
    them to be msec as appropriate.

    Some metrics with type KERNEL_ULONG had some explcit uint32
    conversions.  Try to generalize.

 src/pmdas/linux/convert.h        |    2 +
 src/pmdas/linux_proc/help_text.h |    2 +-
src/pmdas/linux_proc/pmda.c | 57 ++++++++++++++++---------------------
 3 files changed, 28 insertions(+), 33 deletions(-)






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