mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-12 09:17:41 +03:00
(cherry picked from commit 42df8eb2e3
)
This commit is contained in:
parent
d93d84842d
commit
4c50a44ba6
@ -166,7 +166,7 @@ module KVM
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.number_of_processors
|
def self.number_of_processors
|
||||||
%x{nproc}.to_i
|
`grep -c processor /proc/cpuinfo`.to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get_cpu_jiffies
|
def self.get_cpu_jiffies
|
||||||
|
@ -162,7 +162,7 @@ module LXD
|
|||||||
# @param vm_names [Array] of vms indexed by name. Value is a hash with :pid
|
# @param vm_names [Array] of vms indexed by name. Value is a hash with :pid
|
||||||
# @return [Hash] with ps information
|
# @return [Hash] with ps information
|
||||||
def get_cpu(vm_names)
|
def get_cpu(vm_names)
|
||||||
multiplier = `nproc`.to_i * 100
|
multiplier = `grep -c processor /proc/cpuinfo`.to_i * 100
|
||||||
|
|
||||||
start_cpu_jiffies = get_cpu_jiffies
|
start_cpu_jiffies = get_cpu_jiffies
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user