forked from TrueCloudLab/frostfs-node
[#1422] multinet: Add metrics
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
2d064d0bd8
commit
c0a2f20eee
9 changed files with 93 additions and 6 deletions
|
@ -764,7 +764,9 @@ func initShared(appCfg *config.Config, key *keys.PrivateKey, netState *networkSt
|
|||
persistate, err := state.NewPersistentStorage(nodeconfig.PersistentState(appCfg).Path())
|
||||
fatalOnErr(err)
|
||||
|
||||
ds, err := internalNet.NewDialerSource(internalNetConfig(appCfg))
|
||||
nodeMetrics := metrics.NewNodeMetrics()
|
||||
|
||||
ds, err := internalNet.NewDialerSource(internalNetConfig(appCfg, nodeMetrics.MultinetMetrics()))
|
||||
fatalOnErr(err)
|
||||
|
||||
cacheOpts := cache.ClientCacheOpts{
|
||||
|
@ -785,17 +787,18 @@ func initShared(appCfg *config.Config, key *keys.PrivateKey, netState *networkSt
|
|||
bgClientCache: cache.NewSDKClientCache(cacheOpts),
|
||||
putClientCache: cache.NewSDKClientCache(cacheOpts),
|
||||
persistate: persistate,
|
||||
metricsCollector: metrics.NewNodeMetrics(),
|
||||
metricsCollector: nodeMetrics,
|
||||
dialerSource: ds,
|
||||
}
|
||||
}
|
||||
|
||||
func internalNetConfig(appCfg *config.Config) internalNet.Config {
|
||||
func internalNetConfig(appCfg *config.Config, m metrics.MultinetMetrics) internalNet.Config {
|
||||
result := internalNet.Config{
|
||||
Enabled: multinet.Enabled(appCfg),
|
||||
Balancer: multinet.Balancer(appCfg),
|
||||
Restrict: multinet.Restrict(appCfg),
|
||||
FallbackDelay: multinet.FallbackDelay(appCfg),
|
||||
Metrics: m,
|
||||
}
|
||||
sn := multinet.Subnets(appCfg)
|
||||
for _, s := range sn {
|
||||
|
@ -1362,7 +1365,7 @@ func (c *cfg) reloadConfig(ctx context.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
if err := c.dialerSource.Update(internalNetConfig(c.appCfg)); err != nil {
|
||||
if err := c.dialerSource.Update(internalNetConfig(c.appCfg, c.metricsCollector.MultinetMetrics())); err != nil {
|
||||
c.log.Error(logs.FailedToUpdateMultinetConfiguration, zap.Error(err))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue