Fix epoch metric #773
1 changed files with 2 additions and 1 deletions
|
@ -562,10 +562,11 @@ func initCfg(appCfg *config.Config) *cfg {
|
||||||
relayOnly := nodeconfig.Relay(appCfg)
|
relayOnly := nodeconfig.Relay(appCfg)
|
||||||
|
|
||||||
fyrchik marked this conversation as resolved
Outdated
|
|||||||
netState := newNetworkState()
|
netState := newNetworkState()
|
||||||
netState.metrics = c.metricsCollector
|
|
||||||
|
|
||||||
c.shared = initShared(appCfg, key, netState, relayOnly)
|
c.shared = initShared(appCfg, key, netState, relayOnly)
|
||||||
|
|
||||||
|
netState.metrics = c.metricsCollector
|
||||||
|
|
||||||
logPrm, err := c.loggerPrm()
|
logPrm, err := c.loggerPrm()
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
logPrm.SamplingHook = c.metricsCollector.LogMetrics().GetSamplingHook()
|
logPrm.SamplingHook = c.metricsCollector.LogMetrics().GetSamplingHook()
|
||||||
|
|
Loading…
Reference in a new issue
So we partially initialize
netState
because we need it ininitShared
and then finalizenetState
initialization.The same problem with metrics can happen inside
initShared
To me the problem is that initialization order in code does not match real order.
What about initializing metrics first somewhere? Or is it too much work?
shared
holds metrics, so looks like metrics are initialized correctly. AlsocfgNetmap
holdsnetstate
, so it also looks ok for me. So i don't think it should be refactored.