mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #17871 from Scotchman0/patch-1
Update printer.go for used/not-used ETCD storage percentage
This commit is contained in:
commit
31adb72f7a
@ -211,7 +211,7 @@ func makeEndpointHealthTable(healthList []epHealth) (hdr []string, rows [][]stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]string) {
|
func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]string) {
|
||||||
hdr = []string{"endpoint", "ID", "version", "storage version", "db size", "db size in use", "is leader", "is learner", "raft term",
|
hdr = []string{"endpoint", "ID", "version", "storage version", "db size", "in use", "percentage not in use", "quota", "is leader", "is learner", "raft term",
|
||||||
"raft index", "raft applied index", "errors"}
|
"raft index", "raft applied index", "errors"}
|
||||||
for _, status := range statusList {
|
for _, status := range statusList {
|
||||||
rows = append(rows, []string{
|
rows = append(rows, []string{
|
||||||
@ -221,6 +221,8 @@ func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]stri
|
|||||||
status.Resp.StorageVersion,
|
status.Resp.StorageVersion,
|
||||||
humanize.Bytes(uint64(status.Resp.DbSize)),
|
humanize.Bytes(uint64(status.Resp.DbSize)),
|
||||||
humanize.Bytes(uint64(status.Resp.DbSizeInUse)),
|
humanize.Bytes(uint64(status.Resp.DbSizeInUse)),
|
||||||
|
fmt.Sprintf("%d%%", int(float64(100-(status.Resp.DbSizeInUse*100/status.Resp.DbSize)))),
|
||||||
|
humanize.Bytes(uint64(status.Resp.DbSizeQuota)),
|
||||||
fmt.Sprint(status.Resp.Leader == status.Resp.Header.MemberId),
|
fmt.Sprint(status.Resp.Leader == status.Resp.Header.MemberId),
|
||||||
fmt.Sprint(status.Resp.IsLearner),
|
fmt.Sprint(status.Resp.IsLearner),
|
||||||
fmt.Sprint(status.Resp.RaftTerm),
|
fmt.Sprint(status.Resp.RaftTerm),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user