[MERGE] Extend -Dhpss to emit a count of HPSS calls to stderr
Andrew Bennetts
andrew at canonical.com
Wed Oct 1 02:24:01 BST 2008
Andrew Bennetts wrote:
> This patch extends the -Dhpss option to dump a count of HPSS calls to
> stderr for each SmartClientMedium that was used.
This updates the patch based on feedback on the list and on IRC.
It's based on the alternative patch from my original mail. The main changes
from my original submission:
* only installs one hook function for the lifetime of the process
* uses trace.note rather than print to stderr
* removes the unnecessary parentheses from the output
* uses a WeakKeyDictionary to track the counts per medium
* it still adds its own weakref so that the _DebugCounter can report the value
in the WeakKeyDictionary before the WeakKeyDictionary destroys it.
I still use both weakref callbacks and an atexit function as a last resort. It
feels cleaner to at least try to remove things as soon as possible, and the
atexit fallback is pretty trivial, so I don't feel the redundancy is a big
issue.
-Andrew.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hpss-call-count.patch
Type: text/x-diff
Size: 10834 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081001/4b4508e4/attachment-0001.bin
More information about the bazaar
mailing list