go-libp2p-daemon
go-libp2p-daemon copied to clipboard
Print stats/diagnostics on system signal
trafficstars
For debugging the state of the daemon, it could be useful to add a hook to catch SIGUSR2 (as we plan to use SIGUSR1 for config reload) that prints statistics/diagnostics to stdout/stderr.
We can output at least:
- [x]
dht.RoutingTable.Print() - [x] active connections with peers.
- [x] active streams with peers, including the protocol id.
- [ ] pubsub subscriptions.
For now, the DHT routing table would suffice, as we actually do need it kind of immediately.
First pass, we dump the routing table on SIGUSR1.
#101 implemented peer and stream dumps.