From c7895ccc528e119b8f5ba421082267f96683dd93 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Mon, 13 Jul 2020 16:15:27 +0200 Subject: [PATCH] metrics: fix pubsub_peers add metric --- libp2p/protocols/pubsub/pubsub.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libp2p/protocols/pubsub/pubsub.nim b/libp2p/protocols/pubsub/pubsub.nim index daa05d1..cab34a2 100644 --- a/libp2p/protocols/pubsub/pubsub.nim +++ b/libp2p/protocols/pubsub/pubsub.nim @@ -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,