refactor(master): reduce dp&mp detail report info

Signed-off-by: Victor1319 <zengxuewei@oppo.com>
This commit is contained in:
Victor1319 2024-08-08 11:34:06 +08:00 committed by AmazingChi
parent 5ef3f6c59b
commit 79ce6ff6cf
2 changed files with 6 additions and 4 deletions

View File

@ -20,6 +20,8 @@ import (
"strconv"
"time"
"github.com/cubefs/cubefs/datanode"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/log"
@ -209,7 +211,7 @@ func (partition *DataPartition) checkMissingReplicas(clusterID, leaderAddr strin
if oldDpReplicaAliveNum != "" {
WarnMetrics.missingDp.DeleteLabelValues(clusterID, id, missingReplicaAddr, oldDpReplicaAliveNum, replicaInfo.replicaNum)
}
WarnMetrics.missingDp.SetWithLabelValues(1, clusterID, id, missingReplicaAddr, replicaInfo.replicaAlive, replicaInfo.replicaNum)
//WarnMetrics.missingDp.SetWithLabelValues(1, clusterID, id, missingReplicaAddr, replicaInfo.replicaAlive, replicaInfo.replicaNum)
}
}
}

View File

@ -349,7 +349,7 @@ func (m *warningMetrics) WarnDpNoLeader(clusterName string, partitionID uint64,
}
if now-info.ReportTime > m.cluster.cfg.DpNoLeaderReportIntervalSec {
if m.dpNoLeader != nil {
m.dpNoLeader.SetWithLabelValues(1, clusterName, strconv.FormatUint(partitionID, 10), strconv.FormatUint(uint64(replicas), 10))
//m.dpNoLeader.SetWithLabelValues(1, clusterName, strconv.FormatUint(partitionID, 10), strconv.FormatUint(uint64(replicas), 10))
}
m.dpNoLeaderInfo[partitionID] = NoLeaderPartInfo{ReportTime: now, Replicas: replicas}
}
@ -395,7 +395,7 @@ func (m *warningMetrics) WarnMissingMp(clusterName, addr string, partitionID uin
}
if m.missingMp != nil {
m.missingMp.SetWithLabelValues(1, clusterName, id, addr)
//m.missingMp.SetWithLabelValues(1, clusterName, id, addr)
}
if _, ok := m.mpMissingReplicaInfo[id]; !ok {
m.mpMissingReplicaInfo[id] = addrSet{addrs: make(map[string]voidType)}
@ -454,7 +454,7 @@ func (m *warningMetrics) WarnMpNoLeader(clusterName string, partitionID uint64,
if now-info.ReportTime > m.cluster.cfg.MpNoLeaderReportIntervalSec {
if m.mpNoLeader != nil {
m.mpNoLeader.SetWithLabelValues(1, clusterName, strconv.FormatUint(partitionID, 10), strconv.FormatUint(uint64(replicas), 10))
//m.mpNoLeader.SetWithLabelValues(1, clusterName, strconv.FormatUint(partitionID, 10), strconv.FormatUint(uint64(replicas), 10))
}
m.mpNoLeaderInfo[partitionID] = NoLeaderPartInfo{ReportTime: now, Replicas: replicas}
}