10.09.2019, 13:37
This will give you load and memory
Code:
data = io.readfile('/proc/meminfo')
load = io.readfile('/proc/loadavg'):split(' ')[ 1 ]
memtotal = data:match('MemTotal:%s+(%d+)')
memavail = data:match('MemAvailable:%s+(%d+)')
memusage = math.floor((memtotal - memavail) / memtotal * 1000) / 10
log(tonumber(load), memusage)
------------------------------
Ctrl+F5
Ctrl+F5