diff --git a/src/main/scala/io/iohk/ethereum/ledger/BlockImport.scala b/src/main/scala/io/iohk/ethereum/ledger/BlockImport.scala index f59df56f31..989d038a48 100644 --- a/src/main/scala/io/iohk/ethereum/ledger/BlockImport.scala +++ b/src/main/scala/io/iohk/ethereum/ledger/BlockImport.scala @@ -73,7 +73,7 @@ class BlockImport( ) if (importedBlocks.nonEmpty) { - importedBlocks.map(blockData => BlockMetrics.measure(blockData.block, blockchain.getBlockByHash)) + importedBlocks.foreach(blockData => BlockMetrics.measure(blockData.block, blockchain.getBlockByHash)) } result diff --git a/src/main/scala/io/iohk/ethereum/ledger/BlockMetrics.scala b/src/main/scala/io/iohk/ethereum/ledger/BlockMetrics.scala index 249cd9f660..b232bc71d9 100644 --- a/src/main/scala/io/iohk/ethereum/ledger/BlockMetrics.scala +++ b/src/main/scala/io/iohk/ethereum/ledger/BlockMetrics.scala @@ -9,6 +9,8 @@ case object BlockMetrics extends MetricsContainer { private[this] final val BlockNumberGauge = metrics.registry.gauge("sync.block.number.gauge", new AtomicDouble(0d)) + private[this] final val CheckpointBlockNumberGauge = + metrics.registry.gauge("sync.block.checkpoint.number.gauge", new AtomicDouble(0d)) private[this] final val BlockGasLimitGauge = metrics.registry.gauge("sync.block.gasLimit.gauge", new AtomicDouble(0d)) private[this] final val BlockGasUsedGauge = @@ -24,6 +26,8 @@ case object BlockMetrics extends MetricsContainer { def measure(block: Block, getBlockByHashFn: ByteString => Option[Block]): Unit = { BlockNumberGauge.set(block.number.toDouble) + if (block.hasCheckpoint) + CheckpointBlockNumberGauge.set(block.number.toDouble) BlockGasLimitGauge.set(block.header.gasLimit.toDouble) BlockGasUsedGauge.set(block.header.gasUsed.toDouble) BlockDifficultyGauge.set(block.header.difficulty.toDouble)