Skip to content

Commit

Permalink
Implement metrics that tracks the base fee (#1784)
Browse files Browse the repository at this point in the history
* NOTICKET: adding a gauge to monitor how the base fee moves over time

* NOTICKET: added baseFee gauge for polybft
  • Loading branch information
jp-imx committed Aug 8, 2023
1 parent d5be69a commit e0e1e36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions consensus/ibft/ibft.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ func (i *backendIBFT) updateMetrics(block *types.Block) {

// Update the Number of transactions in the block metric
metrics.SetGauge([]string{consensusMetrics, "num_txs"}, float32(len(block.Body().Transactions)))

// Update the base fee metric
metrics.SetGauge([]string{consensusMetrics, "base_fee"}, float32(block.Header.BaseFee))
}

// verifyHeaderImpl verifies fields including Extra
Expand Down
3 changes: 3 additions & 0 deletions consensus/polybft/consensus_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func updateBlockMetrics(currentBlock *types.Block, parentHeader *types.Header) e
metrics.IncrCounter([]string{consensusMetricsPrefix, "block_counter"}, float32(1))
metrics.SetGauge([]string{consensusMetricsPrefix, "block_space_used"}, float32(currentBlock.Header.GasUsed))

// Update the base fee metric
metrics.SetGauge([]string{consensusMetricsPrefix, "base_fee"}, float32(currentBlock.Header.BaseFee))

return nil
}

Expand Down

0 comments on commit e0e1e36

Please sign in to comment.