Skip to content

Commit

Permalink
metrics: add head info for double sign slash
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed Apr 19, 2024
1 parent 3b7f0e4 commit 81ecdd9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ var (
headBlockGauge = metrics.NewRegisteredGauge("chain/head/block", nil)
headHeaderGauge = metrics.NewRegisteredGauge("chain/head/header", nil)
headFastBlockGauge = metrics.NewRegisteredGauge("chain/head/receipt", nil)
headHashGauge = metrics.NewRegisteredGaugeInfo("chain/head/hash", nil)
headMinerGauge = metrics.NewRegisteredGaugeInfo("chain/head/miner", nil)

justifiedBlockGauge = metrics.NewRegisteredGauge("chain/head/justified", nil)
finalizedBlockGauge = metrics.NewRegisteredGauge("chain/head/finalized", nil)
Expand Down Expand Up @@ -2296,6 +2298,9 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
bc.cacheReceipts(block.Hash(), receipts, block)

// Update the metrics touched during block commit
headHashGauge.Update(metrics.GaugeInfoValue{"head_hash": block.Hash().String()})
headMinerGauge.Update(metrics.GaugeInfoValue{"head_miner": block.Coinbase().String()})

accountCommitTimer.Update(statedb.AccountCommits) // Account commits are complete, we can mark them
storageCommitTimer.Update(statedb.StorageCommits) // Storage commits are complete, we can mark them
snapshotCommitTimer.Update(statedb.SnapshotCommits) // Snapshot commits are complete, we can mark them
Expand Down

0 comments on commit 81ecdd9

Please sign in to comment.