torproject / nyx

Command-line monitor for Tor.
https://nyx.torproject.org/
GNU General Public License v3.0
113 stars 27 forks source link

Incorrect (?) uptime #41

Open xrisk opened 2 years ago

xrisk commented 2 years ago

Nyx seems to be showing me the “real" uptime of my relay, that is the time since I started it. However, since I have a dynamic address, the effective uptime (the value I see on Onionoo and in Tor logs) is not equivalent to that value. Is there any way I can see that instead?

atagar commented 2 years ago

Hi xrisk. Nyx gets the uptime from tor itself (tor's 'GETINFO uptime' command). What you're asking for is the duration you had an address rather than the process uptime. I'm unaware of a mechanism for Nyx to get that offhand, but if you'd care to make a patch I'd be happy to take a look.

xrisk commented 2 years ago

I do notice lines like this in the Nyx logs:

 18:02:49 [NOTICE] Heartbeat: Tor's uptime is 22:24 hours, with 379 circuits open. I've sent 31.67 GB and received 31.67 GB. 

(Note, uptime as reported by Nyx is 7 days as this point)

I will try looking into the Tor source code to see how these are emitted. Do you have any introductory materials for hacking on Tor?