Skip to content

Commit 00b8534

Browse files
committed
core: Add block processing time metric collection
1 parent 6952fe3 commit 00b8534

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
@@ -949,6 +949,7 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
949949
if glog.V(logger.Debug) {
950950
glog.Infof("[%v] inserted block #%d (%d TXs %v G %d UNCs) (%x...). Took %v\n", time.Now().UnixNano(), block.Number(), len(block.Transactions()), block.GasUsed(), len(block.Uncles()), block.Hash().Bytes()[0:4], time.Since(bstart))
951951
}
952+
blockInsertTimer.UpdateSince(bstart)
952953
events = append(events, ChainEvent{block, block.Hash(), logs})
953954

954955
// This puts transactions in a extra db for rpc
@@ -967,6 +968,7 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
967968
if glog.V(logger.Detail) {
968969
glog.Infof("inserted forked block #%d (TD=%v) (%d TXs %d UNCs) (%x...). Took %v\n", block.Number(), block.Difficulty(), len(block.Transactions()), len(block.Uncles()), block.Hash().Bytes()[0:4], time.Since(bstart))
969970
}
971+
blockInsertTimer.UpdateSince(bstart)
970972
events = append(events, ChainSideEvent{block, logs})
971973

972974
case SplitStatTy:

0 commit comments

Comments
 (0)