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.
|
// 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()
|
now := time.Now()
|
||||||
db := &Dashboard{
|
db := &Dashboard{
|
||||||
conns: make(map[uint32]*client),
|
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),
|
DiskWrite: emptyChartEntries(now, diskWriteSampleLimit, config.Refresh),
|
||||||
},
|
},
|
||||||
commit: commit,
|
commit: commit,
|
||||||
ethServ: _ethServ,
|
ethServ: ethServ,
|
||||||
lesServ: _lesserv,
|
lesServ: lesServ,
|
||||||
}
|
}
|
||||||
return db, nil
|
return db, nil
|
||||||
}
|
}
|
||||||
|
|
@ -313,7 +313,7 @@ func (db *Dashboard) collectData() {
|
||||||
prevDiskRead = curDiskRead
|
prevDiskRead = curDiskRead
|
||||||
prevDiskWrite = curDiskWrite
|
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()
|
p := db.ethServ.Downloader().Progress()
|
||||||
|
|
||||||
metrics.GetOrRegisterGauge("currentBlock", nil).Update(int64(p.CurrentBlock))
|
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("pulledStates", nil).Update(int64(p.PulledStates))
|
||||||
metrics.GetOrRegisterGauge("knownStates", nil).Update(int64(p.KnownStates))
|
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()
|
now := time.Now()
|
||||||
|
|
||||||
runtime.ReadMemStats(&mem)
|
runtime.ReadMemStats(&mem)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue