File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ when defined(libp2p_expensive_metrics):
3535 declareGauge (libp2p_gossipsub_priority_queue_size, " the number of messages in the priority queue" , labels = [" id" ])
3636 declareGauge (libp2p_gossipsub_non_priority_queue_size, " the number of messages in the non-priority queue" , labels = [" id" ])
3737
38+ declareCounter (libp2p_gossipsub_non_priority_msgs_dropped, " the number of dropped messages in the non-priority queue" , labels = [" id" ])
39+
40+
3841type
3942 PeerRateLimitError * = object of CatchableError
4043
@@ -383,6 +386,7 @@ proc sendNonPriorityTask(p: PubSubPeer) {.async.} =
383386 when defined (libp2p_expensive_metrics):
384387 libp2p_gossipsub_non_priority_queue_size.dec (labelValues = [$ p.peerId])
385388 if Moment .now () - ttlMsg.ttl >= p.rpcmessagequeue.maxDurationInNonPriorityQueue:
389+ libp2p_gossipsub_non_priority_msgs_dropped.inc (labelValues = [$ p.peerId])
386390 continue
387391 await p.sendMsg (ttlMsg.msg)
388392
You can’t perform that action at this time.
0 commit comments