only showing online node count (#1702)
This commit is contained in:
parent
1c87a53eb8
commit
061deb6add
@ -143,7 +143,14 @@ func (endpoint *Endpoint) SegmentHealth(ctx context.Context, in *pb.SegmentHealt
|
||||
return nil, Error.Wrap(err)
|
||||
}
|
||||
|
||||
health.OnlineNodes = int32(len(nodes))
|
||||
onlineNodeCount := int32(0)
|
||||
for _, n := range nodes {
|
||||
if n.Online() {
|
||||
onlineNodeCount++
|
||||
}
|
||||
}
|
||||
|
||||
health.OnlineNodes = onlineNodeCount
|
||||
|
||||
if in.GetSegmentIndex() > -1 {
|
||||
health.Segment = []byte("s" + strconv.FormatInt(in.GetSegmentIndex(), 10))
|
||||
|
Loading…
Reference in New Issue
Block a user