freecpu_kvm.diff

Redmine Admin, 01/28/2009 03:50 PM

Download (787 Bytes)

View differences:

opennebula-1.1.85+svn329/src/im_mad/kvm/kvm.rb 2009-01-28 15:27:07.183943661 +0100
56 56
        line[7..-1].split(",").each{|elemento|
57 57
            temp = elemento.strip.split("%")
58 58
            if temp[1]=="id"
59
                $free_cpu = temp[0]
60
                used     = temp[0].to_f
61
                $used_cpu = (((100 - used)*100).round / 100).to_f.to_s
59
                idle = temp[0]
60
                $free_cpu = idle.to_f * $total_cpu.to_f / 100
61
                $used_cpu = $total_cpu.to_f - $free_cpu
62 62
                break
63 63
            end
64 64