forked from TrueCloudLab/neoneo-go
Merge pull request #2992 from nspcc-dev/init-metrics-on-start
*: adjust Prometheus metrics initialisation on node start
This commit is contained in:
commit
29b3df10b6
2 changed files with 9 additions and 1 deletions
|
@ -503,6 +503,10 @@ func (bc *Blockchain) init() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateBlockHeightMetric(bHeight)
|
||||||
|
updatePersistedHeightMetric(bHeight)
|
||||||
|
updateHeaderHeightMetric(bc.HeaderHeight())
|
||||||
|
|
||||||
return bc.updateExtensibleWhitelist(bHeight)
|
return bc.updateExtensibleWhitelist(bHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,6 +636,8 @@ func (bc *Blockchain) resetRAMState(height uint32, resetHeaders bool) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateBlockHeightMetric(height)
|
updateBlockHeightMetric(height)
|
||||||
|
updatePersistedHeightMetric(height)
|
||||||
|
updateHeaderHeightMetric(bc.HeaderHeight())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,9 @@ func (s *Module) CurrentValidatedHeight() uint32 {
|
||||||
func (s *Module) Init(height uint32) error {
|
func (s *Module) Init(height uint32) error {
|
||||||
data, err := s.Store.Get([]byte{byte(storage.DataMPTAux), prefixValidated})
|
data, err := s.Store.Get([]byte{byte(storage.DataMPTAux), prefixValidated})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s.validatedHeight.Store(binary.LittleEndian.Uint32(data))
|
h := binary.LittleEndian.Uint32(data)
|
||||||
|
s.validatedHeight.Store(h)
|
||||||
|
updateStateHeightMetric(h)
|
||||||
}
|
}
|
||||||
|
|
||||||
if height == 0 {
|
if height == 0 {
|
||||||
|
|
Loading…
Reference in a new issue