Reindent file to get rid of tabs

This commit is contained in:
Enric Morales 2019-10-17 13:49:21 +02:00
parent eab7811a21
commit d049694c29
1 changed files with 16 additions and 16 deletions

View File

@ -33,26 +33,26 @@ cpu_openbsd.ticks = { 0, 0, 0, 0, 0, 0 }
function cpu_openbsd.async(format, warg, callback)
helpers.sysctl_async({ "kern.cp_time" },
function (ret)
local current_ticks = {}
for match in string.gmatch(ret["kern.cp_time"], "(%d+)") do
table.insert(current_ticks, tonumber(match))
end
function (ret)
local current_ticks = {}
for match in string.gmatch(ret["kern.cp_time"], "(%d+)") do
table.insert(current_ticks, tonumber(match))
end
local period_ticks = {}
for i=1, 6 do
table.insert(period_ticks,
current_ticks[i] - cpu_openbsd.ticks[i])
end
local period_ticks = {}
for i = 1, 6 do
table.insert(period_ticks,
current_ticks[i] - cpu_openbsd.ticks[i])
end
local cpu_total, cpu_busy = 0, 0
for i = 1, 6 do cpu_total = cpu_total + period_ticks[i] end
for i = 1, 5 do cpu_busy = cpu_busy + period_ticks[i] end
local cpu_total, cpu_busy = 0, 0
for i = 1, 6 do cpu_total = cpu_total + period_ticks[i] end
for i = 1, 5 do cpu_busy = cpu_busy + period_ticks[i] end
local cpu_usage = math.ceil((cpu_busy / cpu_total) * 100 )
local cpu_usage = math.ceil((cpu_busy / cpu_total) * 100 )
cpu_openbsd.ticks = current_ticks
return callback({ cpu_usage })
cpu_openbsd.ticks = current_ticks
return callback({ cpu_usage })
end)
end