mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
dashboard: fix names in constructor
This commit is contained in:
parent
d3aaa46721
commit
7f1841f1f9
1 changed files with 4 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue