Skip to content

Commit

Permalink
fix(kademlia): bootnode metrics (#2557)
Browse files Browse the repository at this point in the history
  • Loading branch information
acud committed Oct 1, 2021
1 parent e05f19b commit 11f9aa8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/topology/kademlia/kademlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,16 @@ func (k *Kad) manage() {
}

if k.bootnode {
k.depthMu.Lock()
depth := k.depth
radius := k.radius
k.depthMu.Unlock()

k.metrics.CurrentDepth.Set(float64(depth))
k.metrics.CurrentRadius.Set(float64(radius))
k.metrics.CurrentlyKnownPeers.Set(float64(k.knownPeers.Length()))
k.metrics.CurrentlyConnectedPeers.Set(float64(k.connectedPeers.Length()))

continue
}

Expand Down

0 comments on commit 11f9aa8

Please sign in to comment.