p2p: fix priority queue bytes pending metric

This commit is contained in:
William Banfield
2021-10-13 15:42:46 -04:00
parent 4fe0f262d4
commit c9521c9e2d

View File

@@ -257,6 +257,9 @@ func (s *pqScheduler) process() {
s.metrics.PeerSendBytesTotal.With(
"chID", chIDStr,
"peer_id", string(pqEnv.envelope.To)).Add(float64(pqEnv.size))
s.metrics.PeerPendingSendBytes.With(
"chID", chIDStr,
"peer_id", string(pqEnv.envelope.To)).Add(float64(-pqEnv.size))
select {
case s.dequeueCh <- pqEnv.envelope:
case <-s.closer.Done():