add some extra gossip metrics
This commit is contained in:
parent
6c7f2766fe
commit
809df8d04d
|
@ -1167,6 +1167,7 @@ method rpcHandler*(g: GossipSub,
|
||||||
# also have to be careful to only include validated messages
|
# also have to be careful to only include validated messages
|
||||||
g.broadcast(toSeq(toSendPeers), RPCMsg(messages: @[msg]))
|
g.broadcast(toSeq(toSendPeers), RPCMsg(messages: @[msg]))
|
||||||
trace "forwared message to peers", peers = toSendPeers.len, msgId, peer
|
trace "forwared message to peers", peers = toSendPeers.len, msgId, peer
|
||||||
|
libp2p_pubsub_messages_rebroadcasted.inc()
|
||||||
|
|
||||||
if rpcMsg.control.isSome:
|
if rpcMsg.control.isSome:
|
||||||
let control = rpcMsg.control.get()
|
let control = rpcMsg.control.get()
|
||||||
|
@ -1302,6 +1303,9 @@ method publish*(g: GossipSub,
|
||||||
when defined(libp2p_expensive_metrics):
|
when defined(libp2p_expensive_metrics):
|
||||||
if peers.len > 0:
|
if peers.len > 0:
|
||||||
libp2p_pubsub_messages_published.inc(labelValues = [topic])
|
libp2p_pubsub_messages_published.inc(labelValues = [topic])
|
||||||
|
else:
|
||||||
|
if peers.len > 0:
|
||||||
|
libp2p_pubsub_messages_published.inc()
|
||||||
|
|
||||||
trace "Published message to peers"
|
trace "Published message to peers"
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,9 @@ declareCounter(libp2p_pubsub_validation_failure, "pubsub failed validated messag
|
||||||
declareCounter(libp2p_pubsub_validation_ignore, "pubsub ignore validated messages")
|
declareCounter(libp2p_pubsub_validation_ignore, "pubsub ignore validated messages")
|
||||||
when defined(libp2p_expensive_metrics):
|
when defined(libp2p_expensive_metrics):
|
||||||
declarePublicCounter(libp2p_pubsub_messages_published, "published messages", labels = ["topic"])
|
declarePublicCounter(libp2p_pubsub_messages_published, "published messages", labels = ["topic"])
|
||||||
|
else:
|
||||||
|
declarePublicCounter(libp2p_pubsub_messages_published, "published messages")
|
||||||
|
declarePublicCounter(libp2p_pubsub_messages_rebroadcasted, "re-broadcasted messages")
|
||||||
|
|
||||||
type
|
type
|
||||||
TopicHandler* = proc(topic: string,
|
TopicHandler* = proc(topic: string,
|
||||||
|
|
Loading…
Reference in New Issue