[tor-bugs] #9317 [BridgeDB]: bridgedb's logger should gather metrics/statistics automatically
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Jul 23 23:10:44 UTC 2013
#9317: bridgedb's logger should gather metrics/statistics automatically
--------------------------------------------+-------------------------------
Reporter: isis | Owner: isis
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: BridgeDB | Version:
Keywords: logging,metrics,thread,context | Parent:
Points: | Actualpoints:
--------------------------------------------+-------------------------------
While writing bridgedb's logger, I made a context manager for storing a
state dictionary which is, so far rather loosely defined, but it would
allow us to gather free statistics on bridgedb. Essentially, you would use
it like so:
{{{
from bridgedb import log as logging
logging.callWithContext(myfoocontext, {'addBridgeAssignment': foobridge})
}}}
It is also safely threadable, so it would be possible to use this to
retrieve debugging information from threads, for instance for #5232.
The nice thing about this is that it is easily called from the logger (and
will still handles log levels and all the other added features from
#9199). The bad thing is that if it is not written very clearly, it could
be difficult for other/new people reading the code to understand,
especially if they are not familiar with Twisted.
Part of this was also discussed between myself and Karsten on tor-
assistants at lists.tpo, earlier this month, in the "BridgeDB data for
metrics" thread.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9317>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list