pcp
[Top] [All Lists]

Re: [pcp] specify instance id's with pmdaCacheStore

To: pcp@xxxxxxxxxxx
Subject: Re: [pcp] specify instance id's with pmdaCacheStore
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Wed, 15 Apr 2015 07:15:50 +1000
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <552D762D.2080400@xxxxxxxxxxx>
References: <552D762D.2080400@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 15/04/15 06:18, Martins Innus wrote:
Hi,

     I was looking through the source and don't think there is a way to
do this, but thought I would ask.  In the case of a pmda where the
instance names are strictly numeric, is it possible to have the
pmdaCache* routines use the instance name (which would be numeric) when
generating the instance id?

Outside the scope when I designed and built the pmdaCache stuff, I'm afraid.

But if the external name is numeric (and >=0 and <= 2^22) then you don't really need the cache routines ... atoi() should suffice n'est ce pas?

     More specifically, I am using the perl pmda api and the
implementation that converts a perl hash to the pmdaCache* routines.

     It seems like the 2 choices are an auto-incrementing internally
assigned id or a deterministic value generated by hashing in
pmdaCache*Key functions.

Hope this makes sense.

I may be missing something ... can't you use the "list" rather than the "hash" version of the perl API and populate the list with the internal instance ids you want?

Certainly the "hash" version from perl appears to give you no control, but the "list" version does not use the pmdaCache routines at all (if I'm reading the PMDA.xs code correctly).

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