Module: Termplot::Commands
- Included in:
- DSL::Panel
- Defined in:
- lib/termplot/commands.rb
Instance Method Summary collapse
Instance Method Details
#cpu ⇒ Object
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 |
#memory ⇒ Object
7 8 9 |
# File 'lib/termplot/commands.rb', line 7 def memory "free | awk 'NR==2 { print ($3/$2) * 100 }'" end |
#random ⇒ Object
3 4 5 |
# File 'lib/termplot/commands.rb', line 3 def random "echo $RANDOM" end |