mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
* feat: add transactions len metrics of block processer * feat: (worker): add metrics * feat: add commitTransaction loops * feat: add metrics to rollup tracing * feat: add metrics to getTxResult * feat: bump version * add state revert metric timer * feat: add commitNewWrok metrics * feat: fix comments * feat: remove the consume part metrics * feat: update * Apply suggestions from code review Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com> * feat: update * feat: address comments * chore: auto version bump [bot] * feat: bump version * add tests * Revert "add tests" This reverts commit 175d544a68fc964dcc062b46c1a010ed821a0996. --------- Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com> Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: georgehao <georgehao@users.noreply.github.com> Co-authored-by: colinlyguo <colinlyguo@scroll.io>
12 lines
218 B
Go
12 lines
218 B
Go
package common
|
|
|
|
import "github.com/scroll-tech/go-ethereum/metrics"
|
|
|
|
// WithTimer calculates the interval of f
|
|
func WithTimer(timer metrics.Timer, f func()) {
|
|
if metrics.Enabled {
|
|
timer.Time(f)
|
|
} else {
|
|
f()
|
|
}
|
|
}
|