metrics: fix pubsub_peers add metric

This commit is contained in:
Jacek Sieka 2020-07-13 16:15:27 +02:00
parent fcda0f6ce1
commit c7895ccc52
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
1 changed files with 4 additions and 0 deletions

View File

@ -144,6 +144,10 @@ proc getOrCreatePeer(p: PubSub,
p.peers[peer.id] = peer
peer.observers = p.observers
# metrics
libp2p_pubsub_peers.set(p.peers.len.int64)
return peer
method handleConn*(p: PubSub,