forked from TrueCloudLab/frostfs-node
[#838] shard: Refactor updateMetrics
method
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
b892feeaf6
commit
29550fe600
1 changed files with 44 additions and 42 deletions
|
@ -398,7 +398,10 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Shard) updateMetrics(ctx context.Context) {
|
func (s *Shard) updateMetrics(ctx context.Context) {
|
||||||
if s.cfg.metricsWriter != nil && !s.GetMode().NoMetabase() {
|
if s.cfg.metricsWriter == nil || s.GetMode().NoMetabase() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
cc, err := s.metaBase.ObjectCounters()
|
cc, err := s.metaBase.ObjectCounters()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.log.Warn(logs.ShardMetaObjectCounterRead,
|
s.log.Warn(logs.ShardMetaObjectCounterRead,
|
||||||
|
@ -444,7 +447,6 @@ func (s *Shard) updateMetrics(ctx context.Context) {
|
||||||
for contID, count := range contCount.Logical {
|
for contID, count := range contCount.Logical {
|
||||||
s.metricsWriter.SetContainerObjectsCount(contID.EncodeToString(), logical, count)
|
s.metricsWriter.SetContainerObjectsCount(contID.EncodeToString(), logical, count)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// incObjectCounter increment both physical and logical object
|
// incObjectCounter increment both physical and logical object
|
||||||
|
|
Loading…
Reference in a new issue