Can you find the total amount of data donated by a Tor node?

Hello, I am a fairly new relay operator, and I was wondering whether the TOR relay search does/should show the total number of gigabytes a relay has donated. This seems like a really useful bit of data for TOR fans like myself to see and compare to other relays.

I couldn’t find the data on https://metrics.torproject.org when searching for my relay, but since this data can be compiled from the (public) bandwidth-time graphs on the relay search, it could be calculated without publicly releasing extra data.

Would you find total bandwidth metrics useful?
Is this already a feature of TOR metrics?

Edit: I wrote some python to calculate this for you from onionoo

import requests, json

fingerprint=input("what is your relay's fingerprint? >")
url = f"https://onionoo.torproject.org/bandwidth?lookup={fingerprint}"
r = requests.get(url)

json_data = json.loads(r.text)

bandwidth_metadata = json_data["relays"][0]["write_history"]["1_month"]#get last month's write history for the first relay found

band_values = bandwidth_metadata["values"]
band_width = float(bandwidth_metadata["interval"])
scale_factor = bandwidth_metadata["factor"]

total = 0
for i in band_values:
    total += i*band_width

total *= scale_factor
total /= 1000000000#gigabytes

print(f"{total} GB donated")
2 Likes

I use vnStat to keep track of bandwidth used, it’s very lightweight, although not process-specific (to my knowledge)

Thx for this :3

Sadly it doesn’t work for a Bridg but the Python Script for Relays is appreciated. Thanks :muscle: