New GETINFO option, "bytes"

Anders Andersson pipatron at gmail.com
Tue Mar 23 23:20:08 UTC 2010


Hi. I added a new option for GETINFO, that will return the total
number of bytes that's gone through Tor since process startup. Just
exporting the internal stats_n_bytes_read/written.

This is very useful for retrieving statistics like bandwidth over
time, for use with tools like arm, vidalia, munin, and other
monitoring applications. The current method that use events is
difficult to use, since you have to listen all the time. With the new
method you can for example poll every minute to see how many bytes was
transferred in total since last you checked.

I wrote a plugin for munin that use this new feature, and it works great.

The patch is trivial, and you probably want to change the name of the
command if you want to use it. There might also be reasons that you
don't want to export and print uint64_t variables. I didn't take time
to check any tor internals guidelines.

// pipe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-a-new-GETINFO-item-bytes.patch
Type: text/x-diff
Size: 2650 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-talk/attachments/20100324/b6be5f82/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Documented-the-bytes-option-for-GETINFO.patch
Type: text/x-diff
Size: 879 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-talk/attachments/20100324/b6be5f82/attachment-0001.patch>


More information about the tor-talk mailing list