Merge pull request #9206 from dvonthenen/feature/issue9163

Exposes alarm/health information in "etcdctl endpoint status"
This commit is contained in:
Gyuho Lee
2018-01-25 07:18:22 -08:00
committed by GitHub
6 changed files with 319 additions and 235 deletions

View File

@@ -174,7 +174,7 @@ func makeMemberListTable(r v3.MemberListResponse) (hdr []string, rows [][]string
}
func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]string) {
hdr = []string{"endpoint", "ID", "version", "db size", "is leader", "raft term", "raft index", "raft applied index"}
hdr = []string{"endpoint", "ID", "version", "db size", "is leader", "raft term", "raft index", "raft applied index", "errors"}
for _, status := range statusList {
rows = append(rows, []string{
status.Ep,
@@ -185,6 +185,7 @@ func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]stri
fmt.Sprint(status.Resp.RaftTerm),
fmt.Sprint(status.Resp.RaftIndex),
fmt.Sprint(status.Resp.RaftAppliedIndex),
fmt.Sprint(strings.Join(status.Resp.Errors, ", ")),
})
}
return hdr, rows

View File

@@ -150,6 +150,7 @@ func (p *fieldsPrinter) EndpointStatus(eps []epStatus) {
fmt.Println(`"RaftIndex" :`, ep.Resp.RaftIndex)
fmt.Println(`"RaftTerm" :`, ep.Resp.RaftTerm)
fmt.Println(`"RaftAppliedIndex" :`, ep.Resp.RaftAppliedIndex)
fmt.Println(`"Errors" :`, ep.Resp.Errors)
fmt.Printf("\"Endpoint\" : %q\n", ep.Ep)
fmt.Println()
}