pcp
[Top] [All Lists]

Re: MySQL PMDA

To: Michal Kara <lemming@xxxxxxxxxxxxxxxxxxx>
Subject: Re: MySQL PMDA
From: Mark Goodwin <markgw@xxxxxxx>
Date: Mon, 22 May 2000 10:15:56 +1000 (EST)
Cc: pcp@xxxxxxxxxxx
Fake-sender: owner-pcp@oss.sgi.com
In-reply-to: <20000519090523.39116@arthur.plbohnice.cz>
Sender: Majordomo List Manager <majordomo@xxxxxxxxxxx>
On Fri, 19 May 2000, Michal Kara wrote:

> > time to work on it [note: this reply is cc mysql@xxxxxxxxxxxxxxx].
> >
>   I will cc this reply too. I am not personally on mysql maillist.

My earlier cc to this list bounced for some reason.

> It is there and it is the plain text help file. However, 'pminfo -T'
> on any metric says that help text is not available. I have checked
> it with the other pmdas and it seems I am doing it right... I
> have created the pmda from the sendmail pmda, so it should be
> OK if the help works there...

I'll investigate this - I installed your pmda and the help text failed
for me too, so I can reproduce the problem.

>   I guess I understand them :) The instance philosophy is OK, I just have
> to play with the way how the instances are got - seems via the inst
> parameter to the fetch callback. But, er... how are they enumerated? I
> am currently looking on the weblog pmda, it seems it doesn't use the
> callback but overwrites whole fetch function. Anyway, I will look at it,
> I hope I am not too stupid to not being able to figure it out ;)
> 
>                               Michal Kara

There is one call to the callback for each requested instance.
Your PMDA needs to populate an array of pmdaIndom structures,
each of which has a pointer to an array of pmdaInstid structures
(and some other fields). Since you will only have one instance
domain for your PMDA (mysql process id), the pmdaIndom array will only
have one member, and the array of pmdaInstid structures will need
to be dynamically allocated, with one entry per process.

See src/pmdas/simple/simple.c for a "simple" example (with a static
instance domain table), or src/pmdas/linux/pmda.c for a (somewhat bloated)
example that has many instance domains, some of which are dynamic.

-- Mark


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