Skip to content

Commit

Permalink
feat: modify the condition for cluster health
Browse files Browse the repository at this point in the history
  • Loading branch information
jacky-xbb authored and Rory-Z committed Aug 8, 2023
1 parent a1da2a4 commit 8f54d4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions client/client_4.x.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ func (n *cluster4x) getClusterStatus() (cluster collector.ClusterStatus, err err
return
}

cluster.Status = healthy
cluster.Status = unhealthy
cluster.NodeUptime = make(map[string]int64)
cluster.NodeMaxFDs = make(map[string]int)
cluster.CPULoads = make(map[string]collector.CPULoad)

for _, data := range resp.Data {
if data.NodeStatus != "Running" {
cluster.Status = unhealthy
if data.NodeStatus == "Running" {
cluster.Status = healthy
}
nodeName := cutNodeName(data.Node)
cluster.NodeUptime[nodeName] = parseUptimeFor4x(data.Uptime)
Expand Down
6 changes: 3 additions & 3 deletions client/client_5.x.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ func (n *cluster5x) getClusterStatus() (cluster collector.ClusterStatus, err err
return
}

cluster.Status = healthy
cluster.Status = unhealthy
cluster.NodeUptime = make(map[string]int64)
cluster.NodeMaxFDs = make(map[string]int)
cluster.CPULoads = make(map[string]collector.CPULoad)

for _, data := range resp {
if data.NodeStatus != "running" {
cluster.Status = unhealthy
if data.NodeStatus == "running" {
cluster.Status = healthy
}
nodeName := cutNodeName(data.Node)
cluster.NodeUptime[nodeName] = data.Uptime / 1000
Expand Down

0 comments on commit 8f54d4f

Please sign in to comment.