diff options
| author | hhvn <dev@hhvn.uk> | 2023-12-30 13:42:49 +0000 |
|---|---|---|
| committer | hhvn <dev@hhvn.uk> | 2023-12-30 13:42:49 +0000 |
| commit | e13eff1c2c9643bf63a484222430cc3880b98d3d (patch) | |
| tree | c453fb3aeb45ac5799a79cd64c6d8acf36c3050a /status/03-mem.go | |
| parent | 0f4869662c6ea6f5d4b976d5ff95b12d2f1cf198 (diff) | |
Fix memory status
Diffstat (limited to 'status/03-mem.go')
| -rw-r--r-- | status/03-mem.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/status/03-mem.go b/status/03-mem.go index c566c4c..89dbb59 100644 --- a/status/03-mem.go +++ b/status/03-mem.go @@ -37,8 +37,8 @@ func mem(name string) error { if err := checkMemField(mem, "MemAvailable"); err != nil { return err } total := mem["MemTotal"] - avail := mem["MemAvailable"] - p := int(float64(avail) / float64(total) * 100.0) + used := total - mem["MemAvailable"] + p := int(float64(used) / float64(total) * 100.0) cx := 0 cx += u.drawPercentBar(cx, p) |