cmd/geth, core: impl. percentile reporting, instrument insertions
This commit is contained in:
@ -19,6 +19,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/pow"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/rcrowley/go-metrics"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -27,6 +28,8 @@ var (
|
||||
|
||||
blockHashPre = []byte("block-hash-")
|
||||
blockNumPre = []byte("block-num-")
|
||||
|
||||
blockInsertTimer = metrics.GetOrRegisterTimer("core/BlockInsertions", metrics.DefaultRegistry)
|
||||
)
|
||||
|
||||
const (
|
||||
@ -691,7 +694,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
|
||||
self.futureBlocks.Delete(block.Hash())
|
||||
|
||||
stats.processed++
|
||||
|
||||
blockInsertTimer.UpdateSince(bstart)
|
||||
}
|
||||
|
||||
if (stats.queued > 0 || stats.processed > 0 || stats.ignored > 0) && bool(glog.V(logger.Info)) {
|
||||
|
Reference in New Issue
Block a user