small gossipsub metrics change
This commit is contained in:
parent
02ad017107
commit
34c2fbeb16
|
@ -302,16 +302,16 @@ proc rebalanceMesh*(g: GossipSub, topic: string, metrics: ptr MeshMetrics = nil)
|
||||||
|
|
||||||
trace "grafting", grafting = candidates.len
|
trace "grafting", grafting = candidates.len
|
||||||
|
|
||||||
if candidates.len == 0:
|
if candidates.len > 0:
|
||||||
if not isNil(metrics):
|
|
||||||
inc metrics[].noPeersTopics
|
|
||||||
else:
|
|
||||||
for peer in candidates:
|
for peer in candidates:
|
||||||
if g.mesh.addPeer(topic, peer):
|
if g.mesh.addPeer(topic, peer):
|
||||||
g.grafted(peer, topic)
|
g.grafted(peer, topic)
|
||||||
g.fanout.removePeer(topic, peer)
|
g.fanout.removePeer(topic, peer)
|
||||||
grafts &= peer
|
grafts &= peer
|
||||||
|
|
||||||
|
if not isNil(metrics) and g.mesh.peers(topic) == 0:
|
||||||
|
inc metrics[].noPeersTopics
|
||||||
|
|
||||||
else:
|
else:
|
||||||
var meshPeers = toSeq(g.mesh.getOrDefault(topic, initHashSet[PubSubPeer]()))
|
var meshPeers = toSeq(g.mesh.getOrDefault(topic, initHashSet[PubSubPeer]()))
|
||||||
meshPeers.keepIf do (x: PubSubPeer) -> bool: x.outbound
|
meshPeers.keepIf do (x: PubSubPeer) -> bool: x.outbound
|
||||||
|
|
Loading…
Reference in New Issue