10.09.2019, 13:56
(This post was last modified: 10.09.2019, 14:01 by manos@dynamitec.)
(10.09.2019, 13:37)Daniel. Wrote: 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)
Hello Daniel.
Thank you for your reply.
I am getting values 0.24 , 0.25 ... Does this mean the CPU load is 0.24 %?