pcp
[Top] [All Lists]

Re: writing a PMDA: multiple instances to a metric

To: Madhu Sudhan R Tera <mst9696@xxxxxxxxxxx>
Subject: Re: writing a PMDA: multiple instances to a metric
From: Nathan Scott <nathans@xxxxxxx>
Date: Thu, 4 Oct 2001 09:15:58 +1100
Cc: pcp@xxxxxxxxxxx
In-reply-to: <Pine.GSO.4.21.0110030124010.11925-100000@pollux.cis.ksu.edu>; from mst9696@cis.ksu.edu on Wed, Oct 03, 2001 at 01:30:44AM -0500
References: <20011003165617.H472533@wobbly.melbourne.sgi.com> <Pine.GSO.4.21.0110030124010.11925-100000@pollux.cis.ksu.edu>
Sender: owner-pcp@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
hi,

On Wed, Oct 03, 2001 at 01:30:44AM -0500, Madhu Sudhan R Tera wrote:
> Hello Nathan!
> Thanks for your reply.

No problem.

> simple.c illustrates only for metrics that have a single instance.
> It does not show how things work if a metric has multiple instances.

I think you'll find that it does...


$ pminfo -f simple

simple.numfetch
    value 2

simple.color
    inst [0 or "red"] value 2
    inst [1 or "green"] value 102
    inst [2 or "blue"] value 202

simple.now
    inst [1 or "sec"] value 10
    inst [60 or "min"] value 6
    inst [3600 or "hour"] value 7

simple.time.user
    value 0

simple.time.sys
    value 0.01


So, "simple.color" and "simple.now" are both metrics which have
multiple instances.

> Secondly we have made use of type PM_TYPE_STRING because the values
> in the my list are strings (Sadanand who mailed about the same query,
> and myself are both involved in this project)

[and in your earlier mail you wrote:]
> I am writing a pmda called netstat. There are five metrics in it: 
> pid, sport, saddr, dport,bandwidth (indicating the network bandwidth used
> by the corresponding connection). 

The reason I suggested a numeric type rather than string is that
these values would all seem to be numeric - except maybe saddr?
But process ID, bandwidth and port numbers are probably numbers,
right?


> > You will need to use something other than PM_INDOM_NULL here
> > (for all of your metrics).
> could you elaborate more on this,please??

The field where you've put PM_INDOM_NULL must instead be an
indom (INstance DOMain) identifier - eg. the COLOR_INDOM or
NOW_INDOM from simple.c.


On a related note, you may find the PCP programmers guide useful:
    http://techpubs.sgi.com:80/library/tpl/cgi-bin/listdocs.cgi 
and then find "PCP 2.2" in the list, then click Submit & it will
give you a list of URLs - the programmers guide is the 2nd one
listed, and you can read it online.

cheers.

-- 
Nathan

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