Commit 4df1591d by Gregory Nagy

fxd

parent 48694fe5
...@@ -180,17 +180,16 @@ class Client: ...@@ -180,17 +180,16 @@ class Client:
% (self.name, len(running_vms), time.time())) % (self.name, len(running_vms), time.time()))
for vm in running_vms: for vm in running_vms:
vm_proc = psutil.Process(vm[1]) vm_proc = psutil.Process(vm[1])
if ((self.beat % self.kvmCPU) is 0) and vm_proc.is_running(): if (((self.beat % self.kvmCPU) is 0) and vm_proc.is_running()):
mem_perc = vm_proc.get_memory_percent() / 100 * vm[2]
metrics.append("vm.%s.memory.usage %f %d" metrics.append("vm.%s.memory.usage %f %d"
% (vm[0], % (vm[0], mem_perc, time.time()))
vm_proc.get_memory_percent() / 100 * vm[2]), if (((self.beat % self.kvmMem) is 0) and vm_proc.is_running()):
time.time())
if ((self.beat % self.kvmMem) is 0) and vm_proc.is_running():
systemtime = vm_proc.get_cpu_times().system systemtime = vm_proc.get_cpu_times().system
usertime = vm_proc.get_cpu_times().user usertime = vm_proc.get_cpu_times().user
sumCpu = systemtime + usertime sumCpu = systemtime + usertime
metrics.append("vm.%s.cpu.usage %f %d" metrics.append("vm.%s.cpu.usage %f %d"
% (sumCpu, time.time())) % (vm[0], sumCpu, time.time()))
interfaces_list = psutil.network_io_counters( interfaces_list = psutil.network_io_counters(
pernic=True) pernic=True)
if ((self.beat % self.kvmNet) is 0): if ((self.beat % self.kvmNet) is 0):
......
...@@ -4,6 +4,7 @@ from metrics import std ...@@ -4,6 +4,7 @@ from metrics import std
class collectables: class collectables:
__collectables = { __collectables = {
std.cpu.usage.name: [std.cpu.usage], std.cpu.usage.name: [std.cpu.usage],
std.cpu.times.name: [std.cpu.times],
std.memory.usage.name: [std.memory.usage], std.memory.usage.name: [std.memory.usage],
std.swap.usage.name: [std.swap.usage], std.swap.usage.name: [std.swap.usage],
std.user.count.name: [std.user.count], std.user.count.name: [std.user.count],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment