only showing online node count (#1702)

This commit is contained in:
Bill Thorp 2019-04-08 16:55:04 -04:00 committed by GitHub
parent 1c87a53eb8
commit 061deb6add
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))