Class: SigarUnitTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/test/sigar/sigar_test.rb

Overview

Author:

  • Johannes Hiemer.

Instance Method Summary collapse

Instance Method Details

#format_size(size) ⇒ Object



15
16
17
# File 'lib/test/sigar/sigar_test.rb', line 15

def format_size(size)
  return Csigar.format_size(size * 1024)
end

#setupObject



12
13
# File 'lib/test/sigar/sigar_test.rb', line 12

def setup
end

#test_cpuObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/test/sigar/sigar_test.rb', line 19

def test_cpu()
  sigar = Csigar.new
  
  puts "hekljelkeml"
  puts sigar
  
  sigar.cpu_list.each do |cpu|
    puts cpu.user.to_s << " user"
    puts cpu.sys.to_s << " sys"
    puts cpu.idle.to_s << " idle"
    puts cpu.wait.to_s << " wait"
    puts cpu.irq.to_s << " irq"
    puts cpu.soft_irq.to_s << " soft_irq"
    puts cpu.stolen.to_s << " stolen"
    puts cpu.total.to_s << " total"
  end
end