mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
M #-: Fix CPU capacity
For some versions of lscpu scaling is also returned in the form: CPU(s): 8 CPU(s) scaling MHz: 55% So /CPU\(s\)/ matches both lines and the TOTAL_CPU value is not properly computed
This commit is contained in:
parent
e31c5deec0
commit
62c265b502
@ -44,7 +44,7 @@ class LinuxHost
|
||||
@net = {}
|
||||
|
||||
cpuinfo.split(/\n/).each do |line|
|
||||
if line =~ /^CPU\(s\)/
|
||||
if line =~ /^CPU\(s\):/
|
||||
@cpu[:total] = line.split(':')[1].strip.to_i * 100
|
||||
elsif line =~ /^CPU MHz:/
|
||||
@cpu[:speed] = Float(line.split(':')[1].strip.split(' ')[0]).round
|
||||
|
Loading…
x
Reference in New Issue
Block a user