Commit 4df1591d by Gregory Nagy

fxd

parent 48694fe5
......@@ -180,17 +180,16 @@ class Client:
% (self.name, len(running_vms), time.time()))
for vm in running_vms:
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"
% (vm[0],
vm_proc.get_memory_percent() / 100 * vm[2]),
time.time())
if ((self.beat % self.kvmMem) is 0) and vm_proc.is_running():
% (vm[0], mem_perc, time.time()))
if (((self.beat % self.kvmMem) is 0) and vm_proc.is_running()):
systemtime = vm_proc.get_cpu_times().system
usertime = vm_proc.get_cpu_times().user
sumCpu = systemtime + usertime
metrics.append("vm.%s.cpu.usage %f %d"
% (sumCpu, time.time()))
% (vm[0], sumCpu, time.time()))
interfaces_list = psutil.network_io_counters(
pernic=True)
if ((self.beat % self.kvmNet) is 0):
......
......@@ -4,6 +4,7 @@ from metrics import std
class collectables:
__collectables = {
std.cpu.usage.name: [std.cpu.usage],
std.cpu.times.name: [std.cpu.times],
std.memory.usage.name: [std.memory.usage],
std.swap.usage.name: [std.swap.usage],
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