File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ local function worker(format)
2626 for k , v in string.gmatch (line , " ([%a]+):[%s]+([%d]+).+" ) do
2727 if k == " MemTotal" then _mem .total = math.floor (v / 1024 )
2828 elseif k == " MemFree" then _mem .buf .f = math.floor (v / 1024 )
29+ elseif k == " MemAvailable" then _mem .buf .a = math.floor (v / 1024 )
2930 elseif k == " Buffers" then _mem .buf .b = math.floor (v / 1024 )
3031 elseif k == " Cached" then _mem .buf .c = math.floor (v / 1024 )
3132 elseif k == " SwapTotal" then _mem .swp .t = math.floor (v / 1024 )
@@ -35,7 +36,7 @@ local function worker(format)
3536 end
3637
3738 -- Calculate memory percentage
38- _mem .free = _mem .buf .f + _mem . buf . b + _mem . buf . c
39+ _mem .free = _mem .buf .a
3940 _mem .inuse = _mem .total - _mem .free
4041 _mem .bcuse = _mem .total - _mem .buf .f
4142 _mem .usep = math.floor (_mem .inuse / _mem .total * 100 )
You can’t perform that action at this time.
0 commit comments