aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-25 23:18:42 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-25 23:18:42 +0800
commitb0a5be4495962c291a25cbea793e43bad0781510 (patch)
treee058201e7b29c3cb8efd710e20ec1e1f97f64368 /core
parente64625aa8215985c85f97f914a98db081e07714f (diff)
parente9c0b5431cbd7430ddec9fd17983241018fd8a55 (diff)
downloaddexon-b0a5be4495962c291a25cbea793e43bad0781510.tar
dexon-b0a5be4495962c291a25cbea793e43bad0781510.tar.gz
dexon-b0a5be4495962c291a25cbea793e43bad0781510.tar.bz2
dexon-b0a5be4495962c291a25cbea793e43bad0781510.tar.lz
dexon-b0a5be4495962c291a25cbea793e43bad0781510.tar.xz
dexon-b0a5be4495962c291a25cbea793e43bad0781510.tar.zst
dexon-b0a5be4495962c291a25cbea793e43bad0781510.zip
Merge pull request #1321 from karalabe/cut-it-open-3000
Metrics collecting and reporting support
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index e3795f561..3b9b7517b 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -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 (
@@ -118,7 +121,6 @@ func NewChainManager(genesis *types.Block, blockDb, stateDb common.Database, pow
cache: NewBlockCache(blockCacheLimit),
pow: pow,
}
-
// Check the genesis block given to the chain manager. If the genesis block mismatches block number 0
// throw an error. If no block or the same block's found continue.
if g := bc.GetBlockByNumber(0); g != nil && g.Hash() != genesis.Hash() {
@@ -691,7 +693,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)) {