Implement new metric on bidirectional use of connections
Björn Scheuermann and Florian Tschorsch of Uni Düsseldorf want to know what fraction of connections are used bidirectionally. They suggested to count read and written bytes per connection in 10-second intervals and classify connections as "below threshold", "mostly reading", "mostly writing", and "both reading and writing".
I implemented this new metric in branch bidistats in my public repository.
Here are the results of my test relay with a reduced report interval of 2 hours (the actual implementation reports 24 hour intervals):
conn-stats-end 2010-08-10 15:55:05 (7200 s) conn-bi-direct 3199,338,496,530 conn-stats-end 2010-08-10 17:55:05 (7200 s) conn-bi-direct 7524,944,1301,1799
These numbers imply that 530+1799 of 338+496+530+944+1301+1799, or 43.1% of all connections are used bidirectionally.
An open question is whether we should distinguish between connections to other relays and to clients. I wonder if there's an easy way to tell the two connection types apart.