cmd/geth, core: impl. percentile reporting, instrument insertions

This commit is contained in:
Péter Szilágyi
2015-06-21 22:10:24 +03:00
parent b426301467
commit 7f92e708c5
2 changed files with 15 additions and 8 deletions

View File

@ -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)) {