mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Show db in use when print endpoint status (#13639)
This commit is contained in:
parent
02d4de6200
commit
95ae9c19f0
@ -15,6 +15,7 @@ See [code changes](https://github.com/etcd-io/etcd/compare/v3.5.0...v3.6.0).
|
||||
### etcdctl v3
|
||||
|
||||
- Add command to generate [shell completion](https://github.com/etcd-io/etcd/pull/13133).
|
||||
- When print endpoint status, [show db size in use](https://github.com/etcd-io/etcd/pull/13639)
|
||||
|
||||
### etcdutl v3
|
||||
|
||||
|
@ -201,7 +201,7 @@ func makeEndpointHealthTable(healthList []epHealth) (hdr []string, rows [][]stri
|
||||
}
|
||||
|
||||
func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]string) {
|
||||
hdr = []string{"endpoint", "ID", "version", "db size", "is leader", "is learner", "raft term",
|
||||
hdr = []string{"endpoint", "ID", "version", "db size", "db size in use", "is leader", "is learner", "raft term",
|
||||
"raft index", "raft applied index", "errors"}
|
||||
for _, status := range statusList {
|
||||
rows = append(rows, []string{
|
||||
@ -209,6 +209,7 @@ func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]stri
|
||||
fmt.Sprintf("%x", status.Resp.Header.MemberId),
|
||||
status.Resp.Version,
|
||||
humanize.Bytes(uint64(status.Resp.DbSize)),
|
||||
humanize.Bytes(uint64(status.Resp.DbSizeInUse)),
|
||||
fmt.Sprint(status.Resp.Leader == status.Resp.Header.MemberId),
|
||||
fmt.Sprint(status.Resp.IsLearner),
|
||||
fmt.Sprint(status.Resp.RaftTerm),
|
||||
|
@ -156,6 +156,7 @@ func (p *fieldsPrinter) EndpointStatus(eps []epStatus) {
|
||||
p.hdr(ep.Resp.Header)
|
||||
fmt.Printf("\"Version\" : %q\n", ep.Resp.Version)
|
||||
fmt.Println(`"DBSize" :`, ep.Resp.DbSize)
|
||||
fmt.Println(`"DBSizeInUse" :`, ep.Resp.DbSizeInUse)
|
||||
fmt.Println(`"Leader" :`, ep.Resp.Leader)
|
||||
fmt.Println(`"IsLearner" :`, ep.Resp.IsLearner)
|
||||
fmt.Println(`"RaftIndex" :`, ep.Resp.RaftIndex)
|
||||
|
Loading…
x
Reference in New Issue
Block a user