Skip to content

Commit 5b262ff

Browse files
authored
Merge pull request bnb-chain#3156 from holiman/metrics-blocks
core: Add block processing time metric collection
2 parents e8d0538 + 00b8534 commit 5b262ff

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎core/blockchain.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
953953
if glog.V(logger.Debug) {
954954
glog.Infof("inserted block #%d [%x…] in %9v: %3d txs %7v gas %d uncles.", block.Number(), block.Hash().Bytes()[0:4], common.PrettyDuration(time.Since(bstart)), len(block.Transactions()), block.GasUsed(), len(block.Uncles()))
955955
}
956+
blockInsertTimer.UpdateSince(bstart)
956957
events = append(events, ChainEvent{block, block.Hash(), logs})
957958

958959
// This puts transactions in a extra db for rpc
@@ -971,6 +972,7 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
971972
if glog.V(logger.Detail) {
972973
glog.Infof("inserted forked block #%d [%x…] (TD=%v) in %9v: %3d txs %d uncles.", block.Number(), block.Hash().Bytes()[0:4], block.Difficulty(), common.PrettyDuration(time.Since(bstart)), len(block.Transactions()), len(block.Uncles()))
973974
}
975+
blockInsertTimer.UpdateSince(bstart)
974976
events = append(events, ChainSideEvent{block, logs})
975977

976978
case SplitStatTy:

0 commit comments

Comments
 (0)