mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
add mgasps metric
This commit is contained in:
parent
72a7e9ea5a
commit
72251d3346
3 changed files with 7 additions and 0 deletions
|
|
@ -440,6 +440,7 @@ func showMetrics() {
|
|||
blockWriteTimer := metrics.GetOrRegisterResettingTimer("chain/write", nil)
|
||||
|
||||
blockPrefetchExecuteTimer := metrics.GetOrRegisterResettingTimer("chain/prefetch/executes", nil)
|
||||
mgaspsHist := metrics.GetOrRegisterHistogram("chain/execution/mgasps", nil, metrics.NewUniformSample(2000))
|
||||
|
||||
// not important
|
||||
fmt.Println("accountReadSingleTimer", accountReadSingleTimer.Total())
|
||||
|
|
@ -478,6 +479,9 @@ func showMetrics() {
|
|||
|
||||
// total
|
||||
fmt.Println("blockInsertTimer", blockInsertTimer.Total())
|
||||
|
||||
mgasps := mgaspsHist.Snapshot()
|
||||
fmt.Println("mgasps,mean,max,min:", mgasps.Mean(), mgasps.Max(), mgasps.Min())
|
||||
}
|
||||
|
||||
func exportChain(ctx *cli.Context) error {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ var (
|
|||
blockPrefetchTxsInvalidMeter = metrics.NewRegisteredMeter("chain/prefetch/txs/invalid", nil)
|
||||
blockPrefetchTxsValidMeter = metrics.NewRegisteredMeter("chain/prefetch/txs/valid", nil)
|
||||
|
||||
mgaspsHist = metrics.NewRegisteredHistogram("chain/execution/mgasps", nil, metrics.NewUniformSample(2000))
|
||||
|
||||
errInsertionInterrupted = errors.New("insertion is interrupted")
|
||||
errChainStopped = errors.New("blockchain is stopped")
|
||||
errInvalidOldChain = errors.New("invalid old chain")
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ func (st *insertStats) report(chain []*types.Block, index int, snapDiffItems, sn
|
|||
)
|
||||
// Update the Mgas per second gauge
|
||||
chainMgaspsGauge.Update(int64(mgasps))
|
||||
mgaspsHist.Update(int64(mgasps))
|
||||
|
||||
// If we're at the last block of the batch or report period reached, log
|
||||
if index == len(chain)-1 || elapsed >= statsReportLimit {
|
||||
|
|
|
|||
Loading…
Reference in a new issue