Ken,
On 4/14/15 5:15 PM, Ken McDonell wrote:
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?
Range is 0 to just under 2^32 and sparsely populated, so out of range
for that. They are job numbers from a batch scheduler where there are
probably ~10K instances at a time, that over time march through that range.
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?
Thanks, I just implemented that and it works. I was stuck in the
mindset that I needed to use one or the other, but not both at the same
time in a pmda, which is obviously not the case.
Thanks
Martins
|