From a62d5123cd0218e43401ade71200476adca380ca Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Fri, 18 May 2018 23:00:30 +0200 Subject: [PATCH] dashboard: fix names in constructor --- dashboard/dashboard.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 752f23a17c..249ac03a3d 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -81,7 +81,7 @@ type client struct { } // New creates a new dashboard instance with the given configuration. -func New(config *Config, commit string, _ethServ *eth.Ethereum, _lesserv *les.LightEthereum) (*Dashboard, error) { +func New(config *Config, commit string, ethServ *eth.Ethereum, lesServ *les.LightEthereum) (*Dashboard, error) { now := time.Now() db := &Dashboard{ conns: make(map[uint32]*client), @@ -98,8 +98,8 @@ func New(config *Config, commit string, _ethServ *eth.Ethereum, _lesserv *les.Li DiskWrite: emptyChartEntries(now, diskWriteSampleLimit, config.Refresh), }, commit: commit, - ethServ: _ethServ, - lesServ: _lesserv, + ethServ: ethServ, + lesServ: lesServ, } return db, nil } @@ -313,7 +313,7 @@ func (db *Dashboard) collectData() { prevDiskRead = curDiskRead prevDiskWrite = curDiskWrite - // extract metrics from downloaded and push to registry + // extract measurements from eth.Downloader and push to metrics registry p := db.ethServ.Downloader().Progress() metrics.GetOrRegisterGauge("currentBlock", nil).Update(int64(p.CurrentBlock)) @@ -322,14 +322,6 @@ func (db *Dashboard) collectData() { metrics.GetOrRegisterGauge("pulledStates", nil).Update(int64(p.PulledStates)) metrics.GetOrRegisterGauge("knownStates", nil).Update(int64(p.KnownStates)) - syncing := db.ethServ.BlockChain().CurrentHeader().Number.Uint64() >= p.HighestBlock - - if syncing { - metrics.GetOrRegisterGauge("isSyncing", nil).Update(1) - } else { - metrics.GetOrRegisterGauge("isSyncing", nil).Update(0) - } - now := time.Now() runtime.ReadMemStats(&mem)