pcp
[Top] [All Lists]

Re: [pcp] JSON PMDA

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] JSON PMDA
From: David Smith <dsmith@xxxxxxxxxx>
Date: Thu, 07 May 2015 16:05:15 -0500
Cc: pcp <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <422876605.13652980.1430893026406.JavaMail.zimbra@xxxxxxxxxx>
References: <54F9F92D.4010202@xxxxxxxxxx> <552699FE.7040801@xxxxxxxxxx> <2139482617.15593599.1428634701360.JavaMail.zimbra@xxxxxxxxxx> <552D6524.1030803@xxxxxxxxxx> <1237712965.18667183.1429054767135.JavaMail.zimbra@xxxxxxxxxx> <5536C228.8010001@xxxxxxxxxx> <1344441557.4430503.1429658863072.JavaMail.zimbra@xxxxxxxxxx> <55493338.3050609@xxxxxxxxxx> <422876605.13652980.1430893026406.JavaMail.zimbra@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 05/06/2015 01:17 AM, Nathan Scott wrote:
> Hi David,
> 
> ----- Original Message -----
>> [...]
>> OK, here's a quite rough patch that makes the needed changes to cache.c
>> (and associated files), and then modifies the JSON PMDA to use indom
>> caches for cluster and metric assignments. There are several "FIXME"
>> comments scattered throughout the changes, and more code will need to be
>> added to pmda.py to make this more user-friendly. But, it does seem to
>> work in the limited testing I've done.
>>
> 
> Ah excellent, sounds promising.
> 
> +
> +    if (maximum < 0)
> +     return PM_ERR_SIGN;
> +    // FIXME: What do we do if there is already something in the cache
> +    // with an instance greater than the new maximum?
> 
> Possibly return PM_ERR_TOOBIG or PM_ERR_TOOSMALL for this case?
> 
> +    // FIXME 2: Does this maximum value need to be saved/restored when
> +    // the cache itself is saved/restored? Currently only a few things
> +    // from the header are stored.
> +    h->maxinst = maximum;
> 
> Yep, I believe so - see Ken's note below, third paragraph...
> http://www.pcp.io/pipermail/pcp/2015-April/006982.html

This patch is cleaned up a good bit. I fixed the above items and made
several changes to pmda.py.

I've got a question about the "exports" file, which I've never messed
with before. Should I have put the new function at the end of the list?
Do I need to define a new library version?

I've got a "philosophy" question about the pmda itself. Originally, each
array had its own indom cache. For this new version, I've switched to
one indom cache per JSON source (each JSON source is also in its own
cluster). I think I can see a way to switch back to the original method
(by adding another cache that maps cache numbers back to arrays), but I
wasn't sure which way was more "correct".

-- 
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

Attachment: cache_change2.patch
Description: Text Data

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