Module: Termplot::Commands

Included in:
DSL::Panel
Defined in:
lib/termplot/commands.rb

Instance Method Summary collapse

Instance Method Details

#cpuObject



11
12
13
# File 'lib/termplot/commands.rb', line 11

def cpu
  "top -b -n 1 | awk -F',' 'NR==3{ split($4, arr, \" \"); print 100.0 - arr[1] }'"
end

#memoryObject



7
8
9
# File 'lib/termplot/commands.rb', line 7

def memory
  "free | awk 'NR==2 { print ($3/$2) * 100 }'"
end

#randomObject



3
4
5
# File 'lib/termplot/commands.rb', line 3

def random
  "echo $RANDOM"
end