mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
refactor(master): reduce dp&mp detail report info
Signed-off-by: Victor1319 <zengxuewei@oppo.com>
This commit is contained in:
parent
5ef3f6c59b
commit
79ce6ff6cf
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user