celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
19 stars 18 forks source link

fix(p2p): Observe length of peerTracker `tracked` and `disconnected` #145

Open renaynay opened 8 months ago

renaynay commented 8 months ago

It is easier to understand peerTracker health if we make the observe callback directly look at the length of the map at the time of observation rather than observing the ints that are on the exchangeMetrics struct as it's not clear when the peerTracker has X many tracked vs disconnected peers.

Let's instead take the length of the maps directly (rlocking of course), but this will make the metric more understandable.

cc @distractedm1nd