mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: add alarm/health information in endpoint status
Update to remove raftIndex and document the Alarms() interface Fix formatting Fix typo
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user