[PEAK] protocols advice

Phillip J. Eby pje at telecommunity.com
Tue Aug 17 11:56:54 EDT 2004


At 12:25 AM 8/17/04 -0400, Duncan McGreggor wrote:
>I will dig in the various places you mentioned -- thanks! more below...
>
>On Aug 16, 2004, at 10:53 PM, Phillip J. Eby wrote:
>
>>>* If I need to start from the ground up, and we need to write our own 
>>>interface/implementation, what would be the best way to start? Are there 
>>>any examples or sandboxes where something like this/analogous to this 
>>>has been done? I learn best by example ;-)
>>
>>If your data access needs are roughly "get some object via a known key", 
>>then the current "Data Manager" framework is likely to suffice.
>
>The "key" in my case would be the full path and filename of the RRD 
>file... but you mention there is not a mechanism in place to do this. You 
>think this is doable in any way?

Well, if your interface looks something like:

     rrd = rrdManager[path]
     # call various methods on rrd

Then the simple thing to do is to just make a class whose __getitem__ adds 
the path to a base location, and returns an RRDFile instance, perhaps by 
way of a WeakValueDictionary cache so that multiple requests for the same 
path will return the same RRDFile.

Depending on the mechanisms involved, you'd probably subclass EditableFile 
to make RRDFile, and give it RRD-specific methods.  But at this point I 
still haven't a clue, since I don't know what you're going to *do* with RRD 
files.  An example (and your interface doc, if you have one) would be most 
helpful.



>Round Robin Database. It's the son of MRTG.

Ah yes, now I know where I heard that term; it was when I was looking at 
system admin/monitoring tools a few months ago.




More information about the PEAK mailing list