Opened 7 years ago

Closed 7 years ago

#9317 closed enhancement (duplicate)

bridgedb's logger should gather metrics/statistics automatically

Reported by: isis Owned by: isis
Priority: Medium Milestone:
Component: Circumvention/BridgeDB Version:
Severity: Keywords: logging, metrics, thread, context
Cc: isis, asn, sysrqb, aagbsn Actual Points:
Parent ID: #9199 Points:
Reviewer: Sponsor:


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@…, earlier this month, in the "BridgeDB data for metrics" thread.

Child Tickets

Change History (2)

comment:1 Changed 7 years ago by isis

Cc: isis,asn,sysrqb,aagbsnisis, asn, sysrqb, aagbsn
Parent ID: #9199
Status: newassigned

Related: #7525 Design a system for tracking bridge assignment metrics.
Possible Duplicate: #9316 BridgeDB should export statistics

comment:2 Changed 7 years ago by isis

Resolution: duplicate
Status: assignedclosed

Closing as a duplicate of #9316

Note: See TracTickets for help on using tickets.