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