pcp
[Top] [All Lists]

Re: [pcp] JSON PMDA

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] JSON PMDA
From: David Smith <dsmith@xxxxxxxxxx>
Date: Tue, 21 Apr 2015 16:33:28 -0500
Cc: pcp <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1237712965.18667183.1429054767135.JavaMail.zimbra@xxxxxxxxxx>
References: <54F9F92D.4010202@xxxxxxxxxx> <448002717.7934024.1427683964254.JavaMail.zimbra@xxxxxxxxxx> <552699FE.7040801@xxxxxxxxxx> <2139482617.15593599.1428634701360.JavaMail.zimbra@xxxxxxxxxx> <552D6524.1030803@xxxxxxxxxx> <1237712965.18667183.1429054767135.JavaMail.zimbra@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 04/14/2015 06:39 PM, Nathan Scott wrote:
> Hi David,
> 
> ----- Original Message -----
>>> [...]
>>> Yeah - something like that - have a look at src/libpcp_pmda/src/cache.c as
>>> thats how the instance cache number stability is achieved.  Perhaps we can
>>> extend that with additional APIs to help us out here.
>>>
>>
> Its OK to extend the API/ABI, but not to break it.  Which should be all we
> need to do here, I think.  Maybe see if we can reduce the range that those
> cache.c interfaces accept - the two lines with "if (inst == 0x7fffffff) {"
> there look promising.  If we had a h->maxinst there perhaps, instead of the
> hard-coded 2^32-1 limit (may need to change the test to '>=' too) we might
> be done and dusted here.  That'll turn out to be a gross oversimplification
> I'm sure ... but maybe, just maybe it will work.

OK, I've been staring at cache.c today, and I've figured out a couple of
things.

- Most of the existing code is for an instance cache, there doesn't
appear to be any existing code for a cluster/metric cache.

- I'm failing to see how changing that 0x07ffffff as you outlined above
helps. Can you explain that a bit more?

If you'd like me to add a cluster/metric cache, I'm going to need a bit
more explanation about what that will entail.

>From a PMDA writer's point of view, I'd think the new APIs would look
something like (in pseudo code):

- lookup_cluster(domain_id, name)
- find_next_available_cluster(domain_id)
- lookup_metric(domain_id, cluster_id, name)
- find_next_available_metric(domain_id, cluster_id)

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

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