mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +00:00
Adding gas used metric
This commit is contained in:
parent
6506fd03ab
commit
b2d9df8799
1 changed files with 2 additions and 0 deletions
|
|
@ -71,6 +71,7 @@ var (
|
|||
diffNoTurn = big.NewInt(1) // Block difficulty for out-of-turn signatures
|
||||
|
||||
blockSizeGaugeName = "clique/block_size_in_bytes"
|
||||
gasUsedInBlock = "clique/gas_used_in_block"
|
||||
)
|
||||
|
||||
// Various error messages to mark blocks invalid. These should be private to
|
||||
|
|
@ -591,6 +592,7 @@ func (c *Clique) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *
|
|||
|
||||
if metrics.Enabled {
|
||||
metrics.GetOrRegisterGauge(blockSizeGaugeName, nil).Update(int64(block.Size()))
|
||||
metrics.GetOrRegisterGauge(gasUsedInBlock, nil).Update(int64(block.GasUsed()))
|
||||
}
|
||||
return block, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue