B #4250: Fix LXD monitoring log (#4346)

This commit is contained in:
Daniel Clavijo Coca authored and GitHub committed 2020-03-11 20:37:09 +01:00
1 parent ca205ae63d
commit 756b8d630b
2 files changed
+4 -6

No files matched your search

+1 -1
View File
@@ -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}')
+3 -5
View File
@@ -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