From f5da8833b6950e8c13c90f713405e5cf0448ff5a Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Tue, 22 Feb 2022 08:55:49 +0700 Subject: [PATCH] erigon2: exec metric (#3567) --- cmd/state/commands/erigon2.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/state/commands/erigon2.go b/cmd/state/commands/erigon2.go index b9ee4a119..256ebe9e9 100644 --- a/cmd/state/commands/erigon2.go +++ b/cmd/state/commands/erigon2.go @@ -14,6 +14,7 @@ import ( "syscall" "time" + metrics2 "github.com/VictoriaMetrics/metrics" "github.com/holiman/uint256" "github.com/ledgerwatch/erigon-lib/aggregator" libcommon "github.com/ledgerwatch/erigon-lib/common" @@ -48,6 +49,8 @@ var ( commitments bool ) +var blockExecutionTimer = metrics2.GetOrCreateSummary("chain_execution_seconds") + func init() { withBlock(erigon2Cmd) withDatadir(erigon2Cmd) @@ -271,6 +274,7 @@ func Erigon2(genesis *core.Genesis, logger log.Logger) error { } func runBlock2(trace bool, txNumStart uint64, rw *ReaderWrapper, ww *WriterWrapper, chainConfig *params.ChainConfig, getHeader func(hash common.Hash, number uint64) *types.Header, block *types.Block, vmConfig vm.Config) (uint64, types.Receipts, error) { + defer blockExecutionTimer.UpdateDuration(time.Now()) header := block.Header() vmConfig.TraceJumpDest = true engine := ethash.NewFullFaker()