Skip to content

Commit

Permalink
Merge pull request #17871 from Scotchman0/patch-1
Browse files Browse the repository at this point in the history
Update printer.go for used/not-used ETCD storage percentage
  • Loading branch information
ahrtr committed May 21, 2024
2 parents 1714b25 + 59864bc commit 31adb72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion etcdctl/ctlv3/command/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func makeEndpointHealthTable(healthList []epHealth) (hdr []string, rows [][]stri
}

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"}
for _, status := range statusList {
rows = append(rows, []string{
Expand All @@ -221,6 +221,8 @@ func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]stri
status.Resp.StorageVersion,
humanize.Bytes(uint64(status.Resp.DbSize)),
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.IsLearner),
fmt.Sprint(status.Resp.RaftTerm),
Expand Down

0 comments on commit 31adb72

Please sign in to comment.