Add a metric to record txs in a block

This commit is contained in:
Roy Lou 2024-04-19 19:50:19 +08:00
parent 0252f85816
commit f7d09c2f27
No known key found for this signature in database
GPG key ID: 107128D2596781C6

View file

@ -116,6 +116,8 @@ var (
l2CommitTraceTimer = metrics.NewRegisteredTimer("miner/commit/trace", nil) l2CommitTraceTimer = metrics.NewRegisteredTimer("miner/commit/trace", nil)
l2CommitCCCTimer = metrics.NewRegisteredTimer("miner/commit/ccc", nil) l2CommitCCCTimer = metrics.NewRegisteredTimer("miner/commit/ccc", nil)
l2ResultTimer = metrics.NewRegisteredTimer("miner/result/all", 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. // 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) delete(w.pendingTasks, sealHash)
w.pendingMu.Unlock() w.pendingMu.Unlock()
} }
l2TaskCommitTxMeter.Mark(int64(len(task.block.Transactions())))
case <-w.exitCh: case <-w.exitCh:
interrupt() interrupt()
return return