class Perus::Pinger::Mem

Public Instance Methods

run() click to toggle source
# File lib/perus/pinger/metrics/mem.rb, line 6
def run
    percent = shell(%Q[cat /proc/meminfo | awk '{if ($1=="MemTotal:") total = $2; if ($1 == "MemFree:") free = $2;} END {print (1 - (free / total))*100}'])
    {mem_all: percent.to_f}
end