mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-25 22:26:26 +09:00
1 parent
ca205ae63d
commit
756b8d630b
2 files changed
+4
-6
No files matched your search
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
cmd='lxc profile list'
|
||||
cmd='lxc profile list 2>/dev/null'
|
||||
|
||||
profiles=$($cmd | grep -v -- -+- | grep -v NAME | grep -v default | awk '{print $2}')
|
||||
|
||||
|
||||
@@ -148,9 +148,7 @@ module LXD
|
||||
'/memory.usage_in_bytes').to_i
|
||||
|
||||
stat / 1024
|
||||
rescue => e
|
||||
OpenNebula.log e
|
||||
|
||||
rescue
|
||||
0
|
||||
end
|
||||
|
||||
@@ -212,14 +210,14 @@ module LXD
|
||||
|
||||
def get_process_jiffies(vm_name)
|
||||
jiffies = 0
|
||||
|
||||
stat = File.read('/sys/fs/cgroup/cpu,cpuacct/'\
|
||||
"#{lxc_path(vm_name)}/cpuacct.stat")
|
||||
|
||||
stat.lines.each {|line| jiffies += line.split(' ')[1].to_i }
|
||||
|
||||
jiffies
|
||||
rescue => e
|
||||
OpenNebula.log e
|
||||
rescue
|
||||
0
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user