pcp
[Top] [All Lists]

Re: [pcp] [RFC] pcp python patch

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] [RFC] pcp python patch
From: David Smith <dsmith@xxxxxxxxxx>
Date: Mon, 17 Nov 2014 12:56:48 -0600
Cc: pcp <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <370186244.15487866.1416205739744.JavaMail.zimbra@xxxxxxxxxx>
References: <54512E80.9090302@xxxxxxxxxx> <1832581184.7889066.1415166007440.JavaMail.zimbra@xxxxxxxxxx> <545A53B0.9030500@xxxxxxxxxx> <704052736.8837998.1415255680009.JavaMail.zimbra@xxxxxxxxxx> <545CEE9A.5060007@xxxxxxxxxx> <615631257.11639679.1415673601327.JavaMail.zimbra@xxxxxxxxxx> <54667179.1060605@xxxxxxxxxx> <370186244.15487866.1416205739744.JavaMail.zimbra@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
On 11/17/2014 12:28 AM, Nathan Scott wrote:
> 
> 
> ----- Original Message -----
>> [...]
>> So, commit b2e3b5c in the pcpfans.git dsmith/dev branch does things as I
>> discussed above. That dramatically simplifies the changes to pmda.py (1)
>> and the refresh_metrics wrapper in pmda.py goes completely away.
> 
> Nice.
> 
>> (1) Except for one thing. I about went nuts with one problem. So we
>> stashed list/dictionary references down in cpmda. I'd update the
>> list/dictionaries in pmda.py and would see newly added metric info, but
>> if I cleared the metrics, I'd still get the old values. I finally
>> figured out the difference between 'dict = []' and 'dict.clear()'. The
>> former assigns a new empty dictionary while the latter clears out the
>> current dictionary. At the pmda.py level there really isn't any
>> difference, but the caused problems for cpmda which had a stashed
>> reference to the original dictionary, not the new one.
> 
> Argh!  Good find. 

This would only have affected anyone who called
clear_metrics()/reset_metrics() or clear_indoms().

> Do we need a new API to allow new dictionary object
> ref(s) to be pushed down to cpmda, overwriting the old?

Hmm, I'm not really seeing a use case for that with the way the PMDA
class is currently written. What is your thought here?

-- 
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>