pcp
[Top] [All Lists]

Re: [pcp] Querying a single instance of metric

To: chandana@xxxxxxxxxxxxx
Subject: Re: [pcp] Querying a single instance of metric
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Wed, 28 Mar 2012 10:07:47 +1100 (EST)
Cc: pcp@xxxxxxxxxxx
In-reply-to: <4F723B28.9040005@xxxxxxxxxxxxx>



Hello All

I am trying to query a single instance of a metric which is visible when
you query all instances:

[chandana@tardis tmp]$ pminfo -f -a 20120327 kernel.percpu.cpu.idle

kernel.percpu.cpu.idle
     inst [0 or "cpu0"] value 63792152140
     inst [1 or "cpu1"] value 69386074790
     inst [2 or "cpu2"] value 73923012890
     inst [3 or "cpu3"] value 67765150660

But not when you query one instance.

[chandana@tardis tmp]$ pminfo -f -a 20120327 kernel.percpu.cpu.idle[0]
Error: kernel.percpu.cpu.idle[0]: Unknown metric name

Why doesn't this one work ? I want to be able to list a single instance.
I am sure that I have doe this before .. It is the same on all the
tools. What am I doing wrong ?

<chandana>  pminfo -f kernel.percpu.cpu.user[0]
<nathans> chandana, that syntax is incorrect (pminfo doesnt support metric names like that)
<chandana> same problem with pmdumptext
<nathans> chandana, the shell may be expanding those braces too
<nathans> chandana, try: pmdumptext kernel.percpu.cpu.user[cpu0]
<chandana> yes, that works, thanks

It's sufficiently confusing that it might be worth tackling (i.e. making pminfo use pmParseMetricSpec
and set a profile if a single instance is requested) ... but, I have some vague memory of some people
not wanting that (extra complexity in pminfo? not sure - it does have to handle the case of the request
not being a leaf node).  I can't remember the details though, maybe Mark or Ken can.  I would vote
for doin' it FWIW, unless theres a compelling case - it comes up often enough, and its a bit confusing.

cheers.

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