From f7d09c2f276a07905e11a275659217d82a8cda26 Mon Sep 17 00:00:00 2001 From: Roy Lou Date: Fri, 19 Apr 2024 19:50:19 +0800 Subject: [PATCH] Add a metric to record txs in a block --- miner/worker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index 7764786fcd..01ce468c44 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -116,6 +116,8 @@ var ( l2CommitTraceTimer = metrics.NewRegisteredTimer("miner/commit/trace", nil) l2CommitCCCTimer = metrics.NewRegisteredTimer("miner/commit/ccc", nil) l2ResultTimer = metrics.NewRegisteredTimer("miner/result/all", nil) + + l2TaskCommitTxMeter = metrics.NewRegisteredMeter("miner/task/commit_txs", nil) ) // environment is the worker's current environment and holds all of the current state information. @@ -691,6 +693,7 @@ func (w *worker) taskLoop() { delete(w.pendingTasks, sealHash) w.pendingMu.Unlock() } + l2TaskCommitTxMeter.Mark(int64(len(task.block.Transactions()))) case <-w.exitCh: interrupt() return