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
|