Skip to content

Commit

Permalink
add reannounce metric for txpool (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: andyzhang2023 <andyzhang2023@gmail.com>
  • Loading branch information
andyzhang2023 and andyzhang2023 authored Jan 5, 2024
1 parent 1f69107 commit 7a5b85e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ var (
)

var (
staledMeter = metrics.NewRegisteredMeter("txpool/staled/count", nil) // staled transactions

// Metrics for the pending pool
pendingDiscardMeter = metrics.NewRegisteredMeter("txpool/pending/discard", nil)
pendingReplaceMeter = metrics.NewRegisteredMeter("txpool/pending/replace", nil)
Expand Down Expand Up @@ -452,6 +454,7 @@ func (pool *TxPool) loop() {
return txs
}()
pool.mu.RUnlock()
staledMeter.Mark(int64(len(reannoTxs)))
if len(reannoTxs) > 0 {
pool.reannoTxFeed.Send(core.ReannoTxsEvent{reannoTxs})
}
Expand Down

0 comments on commit 7a5b85e

Please sign in to comment.