Skip to content

Commit

Permalink
fixed average mgas metric in logs (#12472)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 authored Oct 25, 2024
1 parent 3dd73c9 commit b3cc0f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions turbo/execution/eth1/forkchoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ func (e *EthereumExecutionModule) updateForkChoice(ctx context.Context, original
gasUsedMgas := float64(fcuHeader.GasUsed) / 1e6
mgasPerSec := gasUsedMgas / totalTime.Seconds()
metrics.ChainTipMgasPerSec.Add(mgasPerSec)
e.avgMgasSec = (e.avgMgasSec*float64(e.recordedMgasSec) + mgasPerSec) / float64(e.recordedMgasSec+1)
e.recordedMgasSec++
logArgs = append(logArgs, "number", fcuHeader.Number.Uint64(), "execution", blockTimings[engine_helpers.BlockTimingsValidationIndex], "mgas/s", fmt.Sprintf("%.2f", mgasPerSec), "average mgas/s", fmt.Sprintf("%.2f", e.avgMgasSec))
if !e.syncCfg.ParallelStateFlushing {
Expand Down

0 comments on commit b3cc0f6

Please sign in to comment.