Skip to content

Commit

Permalink
Added chain_head_gasprice gauge metric
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortejoso committed Dec 1, 2023
1 parent 7a2785a commit 3824220
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ import (
)

var (
headBlockGauge = metrics.NewRegisteredGauge("chain/head/block", nil)
headHeaderGauge = metrics.NewRegisteredGauge("chain/head/header", nil)
headFastBlockGauge = metrics.NewRegisteredGauge("chain/head/receipt", nil)
headBlockGauge = metrics.NewRegisteredGauge("chain/head/block", nil)
headHeaderGauge = metrics.NewRegisteredGauge("chain/head/header", nil)
headFastBlockGauge = metrics.NewRegisteredGauge("chain/head/receipt", nil)
headBlockGasPriceMin = metrics.NewRegisteredGauge("chain/head/gasprice", nil)

accountReadTimer = metrics.NewRegisteredTimer("chain/account/reads", nil)
accountHashTimer = metrics.NewRegisteredTimer("chain/account/hashes", nil)
Expand Down Expand Up @@ -476,6 +477,8 @@ func (bc *BlockChain) loadLastState() error {
}
log.Debug(fmt.Sprintf("Loading Last State: %v", currentHeader.Number))
bc.hc.SetCurrentHeader(currentHeader)
// Update the head block gas price minimum
headBlockGasPriceMin.Update(currentHeader.BaseFee.Int64())

// Restore the last known head fast block
bc.currentFastBlock.Store(currentBlock)
Expand Down

0 comments on commit 3824220

Please sign in to comment.