Skip to content

Commit

Permalink
metrics at a better position
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhang2023 committed Sep 11, 2024
1 parent 524c366 commit a5648fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eth/protocols/eth/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ func (p *Peer) broadcastTransactions() {
}
queue = queue[:copy(queue, queue[hashesCount:])]

txP2PBroadQueueGauge.Update(int64(len(queue)))

// If there's anything available to transfer, fire up an async writer
if len(txs) > 0 {
done = make(chan struct{})
Expand Down Expand Up @@ -137,6 +135,8 @@ func (p *Peer) broadcastTransactions() {
queue = queue[:copy(queue, queue[len(queue)-maxQueuedTxs:])]
}

txP2PBroadQueueGauge.Update(int64(len(queue)))

case <-done:
done = nil

Expand Down Expand Up @@ -181,8 +181,6 @@ func (p *Peer) announceTransactions() {
// Shift and trim queue
queue = queue[:copy(queue, queue[count:])]

txP2PAnnQueueGauge.Update(int64(len(queue)))

// If there's anything available to transfer, fire up an async writer
if len(pending) > 0 {
done = make(chan struct{})
Expand Down Expand Up @@ -214,6 +212,8 @@ func (p *Peer) announceTransactions() {
queue = queue[:copy(queue, queue[len(queue)-maxQueuedTxAnns:])]
}

txP2PAnnQueueGauge.Update(int64(len(queue)))

case <-done:
done = nil

Expand Down

0 comments on commit a5648fb

Please sign in to comment.