Skip to content

Commit

Permalink
chore: change some gauge metrics to counter
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoieh committed Dec 6, 2024
1 parent 70ed618 commit 9281794
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ var (
accountTrieReadsTimer = metrics.NewRegisteredTimer("txpool/account/trie/readtime", nil)

feedTimer = metrics.NewRegisteredTimer("txpool/feed/time", nil)
sendFeedTxGauge = metrics.NewRegisteredGauge("txpool/sendfeed/tx", nil)
demoteTxGauge = metrics.NewRegisteredGauge("txpool/demote/tx/count", nil)
sendFeedTxCount = metrics.NewRegisteredCounter("txpool/sendfeed/tx", nil)
demoteTxCount = metrics.NewRegisteredCounter("txpool/demote/tx/count", nil)

loopReportTimer = metrics.NewRegisteredTimer("txpool/loop/report", nil)
)
Expand Down Expand Up @@ -1592,7 +1592,7 @@ func (pool *LegacyPool) runReorg(done chan struct{}, reset *txpoolResetRequest,
if reset != nil {
demoted := pool.demoteUnexecutables(demoteAddrs)
pool.metrics.Tps.Pending2Nil.mark(demoteCost, demoted)
demoteTxGauge.Inc(int64(demoted))
demoteTxCount.Inc(int64(demoted))
var pendingBaseFee = pool.priced.urgent.baseFee
if reset.newHead != nil {
if pool.chainconfig.IsLondon(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) {
Expand Down Expand Up @@ -1638,7 +1638,7 @@ func (pool *LegacyPool) runReorg(done chan struct{}, reset *txpoolResetRequest,
txs = append(txs, set.Flatten()...)
}
pool.txFeed.Send(core.NewTxsEvent{Txs: txs})
sendFeedTxGauge.Inc(int64(len(txs)))
sendFeedTxCount.Inc(int64(len(txs)))
pool.metrics.Tps.Pending2P2P.mark(time.Since(t0), len(txs))
}
feedTimer.Update(time.Since(t0))
Expand Down

0 comments on commit 9281794

Please sign in to comment.