Skip to content

Commit 366a890

Browse files
committed
cli: show CPU utilization (EMA); load-averages only when verbose
* add "SYS CPU(%)" column replacing "LOAD AVERAGE" - show "LOAD AVERAGE" when '--verbose' * show "THROTTLED(%)" column iff any node reports non-zero cgroup v2 value * update 'ais show cluster' help * 'ais performance' - adding extended comment, leaving it intact for now ----- * up modules to pick up new `apc.MemCPUInfo` * part eight, prev. commit: 074554a Signed-off-by: Alex Aizman <alex.aizman@gmail.com>
1 parent 074554a commit 366a890

6 files changed

Lines changed: 193 additions & 86 deletions

File tree

cmd/cli/cli/daeclu.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ type (
7373
func cluDaeStatus(c *cli.Context, smap *meta.Smap, tstatusMap, pstatusMap teb.StstMap, cfg *cmn.ClusterConfig, sid string, withRichAnalytics bool) error {
7474
var (
7575
usejs = flagIsSet(c, jsonFlag)
76+
verbose = flagIsSet(c, verboseFlag)
7677
hideHeader = flagIsSet(c, noHeaderFlag)
7778
units, errU = parseUnitsFlag(c, unitsFlag)
7879
)
@@ -89,23 +90,23 @@ func cluDaeStatus(c *cli.Context, smap *meta.Smap, tstatusMap, pstatusMap teb.St
8990
}
9091
if res, ok := pstatusMap[sid]; ok {
9192
h := teb.StatsAndStatusHelper{Pmap: teb.StstMap{res.Snode.ID(): res}}
92-
table := h.MakeTabP(smap, units)
93+
table := h.MakeTabP(smap, units, verbose)
9394
out := table.Template(hideHeader)
9495
return teb.Print(res, out, teb.Jopts(usejs))
9596
}
9697
if res, ok := tstatusMap[sid]; ok {
9798
h := teb.StatsAndStatusHelper{Tmap: teb.StstMap{res.Snode.ID(): res}}
98-
table := h.MakeTabT(smap, units)
99+
table := h.MakeTabT(smap, units, verbose)
99100
out := table.Template(hideHeader)
100101
return teb.Print(res, out, teb.Jopts(usejs))
101102
}
102103
if sid == apc.Proxy {
103-
table := body.Stst.MakeTabP(smap, units)
104+
table := body.Stst.MakeTabP(smap, units, verbose)
104105
out := table.Template(hideHeader)
105106
return teb.Print(body, out, teb.Jopts(usejs))
106107
}
107108
if sid == apc.Target {
108-
table := body.Stst.MakeTabT(smap, units)
109+
table := body.Stst.MakeTabT(smap, units, verbose)
109110
out := table.Template(hideHeader)
110111
return teb.Print(body, out, teb.Jopts(usejs))
111112
}
@@ -116,8 +117,8 @@ func cluDaeStatus(c *cli.Context, smap *meta.Smap, tstatusMap, pstatusMap teb.St
116117
//
117118
// `ais show cluster` (two tables and Summary)
118119
//
119-
tableP := body.Stst.MakeTabP(smap, units)
120-
tableT := body.Stst.MakeTabT(smap, units)
120+
tableP := body.Stst.MakeTabP(smap, units, verbose)
121+
tableT := body.Stst.MakeTabT(smap, units, verbose)
121122

122123
// totals: num disks and capacity; software version and build time; backend detection
123124
body.NumDisks, body.Capacity = _totals(body.Stst.Tmap, units, cfg)

cmd/cli/cli/show_hdlr.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ var (
122122
BashComplete: bucketCompletions(bcmplop{separator: true}),
123123
}
124124
showCmdCluster = cli.Command{
125-
Name: cmdCluster,
126-
Usage: "Show cluster: health, version and build, and nodes (including capacity and memory, load averages and alerts)",
125+
Name: cmdCluster,
126+
Usage: "Show cluster: health, version and build, and nodes including capacity, memory, CPU utilization, and alerts\n" +
127+
indent4 + "\t(use '--verbose' ('--v') to also include load averages).",
127128
ArgsUsage: showClusterArgument,
128129
Flags: sortFlags(showCmdsFlags[cmdCluster]),
129130
Action: showClusterHandler,

cmd/cli/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/NVIDIA/aistore/cmd/cli
33
go 1.25
44

55
require (
6-
github.com/NVIDIA/aistore v1.4.4-0.20260329184842-1b1397ee3ce0
6+
github.com/NVIDIA/aistore v1.4.4-0.20260401000712-074554a723ca
77
github.com/fatih/color v1.18.0
88
github.com/json-iterator/go v1.1.12
99
github.com/onsi/ginkgo/v2 v2.27.5

cmd/cli/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
22
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
33
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
4-
github.com/NVIDIA/aistore v1.4.4-0.20260329184842-1b1397ee3ce0 h1:3OhwMEwM/zznZq3SW1znlTKsDkTHqjiHHK+RLmjxd9g=
5-
github.com/NVIDIA/aistore v1.4.4-0.20260329184842-1b1397ee3ce0/go.mod h1:lMk/XlagoWh7JVW3unQCwqE9S8E9IIZaBM2mWqxvQ8w=
4+
github.com/NVIDIA/aistore v1.4.4-0.20260401000712-074554a723ca h1:InvFSoNb+GNeul17Tx0kd05cPA4LjRDPUQECwfrp6Lk=
5+
github.com/NVIDIA/aistore v1.4.4-0.20260401000712-074554a723ca/go.mod h1:u/h8aKQqIvjIrQlQyVws9rv0RMFl3KaYHDQLtTYqGZE=
66
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
77
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
88
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=

0 commit comments

Comments
 (0)