mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
metrics: add chain/gas for cumulative gas usage
This commit is contained in:
parent
a56558d092
commit
1196feec4d
1 changed files with 2 additions and 0 deletions
|
|
@ -67,6 +67,7 @@ var (
|
|||
|
||||
chainInfoGauge = metrics.NewRegisteredGaugeInfo("chain/info", nil)
|
||||
chainMgaspsMeter = metrics.NewRegisteredResettingTimer("chain/mgasps", nil)
|
||||
chainGasCounter = metrics.NewRegisteredCounter("chain/gas/total", nil)
|
||||
|
||||
accountReadTimer = metrics.NewRegisteredResettingTimer("chain/account/reads", nil)
|
||||
accountHashTimer = metrics.NewRegisteredResettingTimer("chain/account/hashes", nil)
|
||||
|
|
@ -1888,6 +1889,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness
|
|||
// Report the import stats before returning the various results
|
||||
stats.processed++
|
||||
stats.usedGas += res.usedGas
|
||||
chainGasCounter.Inc(int64(res.usedGas))
|
||||
witness = res.witness
|
||||
|
||||
var snapDiffItems, snapBufItems common.StorageSize
|
||||
|
|
|
|||
Loading…
Reference in a new issue