all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server 0/3] vmstatus: add pressure + hostcpu/hostmem
@ 2020-11-04  1:41 Alexandre Derumier
  2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 1/3] vmstatus: add hostcpu value Alexandre Derumier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexandre Derumier @ 2020-11-04  1:41 UTC (permalink / raw)
  To: pve-devel

Need pve-common patches serie.


Alexandre Derumier (3):
  vmstatus: add hostcpu value
  vmstatus: add hostmem value
  vmstatus: add pressure stats

 PVE/QemuServer.pm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

-- 
2.20.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH qemu-server 1/3] vmstatus: add hostcpu value
  2020-11-04  1:41 [pve-devel] [PATCH qemu-server 0/3] vmstatus: add pressure + hostcpu/hostmem Alexandre Derumier
@ 2020-11-04  1:41 ` Alexandre Derumier
  2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value Alexandre Derumier
  2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 3/3] vmstatus: add pressure stats Alexandre Derumier
  2 siblings, 0 replies; 6+ messages in thread
From: Alexandre Derumier @ 2020-11-04  1:41 UTC (permalink / raw)
  To: pve-devel

---
 PVE/QemuServer.pm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index af74d64..0c2b1db 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2647,8 +2647,11 @@ sub vmstatus {
 
 	my $pstat = PVE::ProcFSTools::read_proc_pid_stat($pid);
 	next if !$pstat; # not running
+	my $cgroups = PVE::QemuServer::CGroup->new($vmid);
+	my $hostcpustat = $cgroups->get_cpu_stat();
 
 	my $used = $pstat->{utime} + $pstat->{stime};
+	my $hostused = $hostcpustat->{utime} + $hostcpustat->{stime};
 
 	$d->{uptime} = int(($uptime - $pstat->{starttime})/$cpuinfo->{user_hz});
 
@@ -2662,6 +2665,9 @@ sub vmstatus {
 		time => $ctime,
 		used => $used,
 		cpu => 0,
+		hostused => $hostused,
+		hostcpu => 0,
+
 	    };
 	    next;
 	}
@@ -2670,15 +2676,20 @@ sub vmstatus {
 
 	if ($dtime > 1000) {
 	    my $dutime = $used -  $old->{used};
+	    my $dhostutime = $hostused -  $old->{hostused};
 
 	    $d->{cpu} = (($dutime/$dtime)* $cpucount) / $d->{cpus};
+	    $d->{hostcpu} = (($dhostutime/$dtime)* $cpucount) / $d->{cpus};
 	    $last_proc_pid_stat->{$pid} = {
 		time => $ctime,
 		used => $used,
 		cpu => $d->{cpu},
+		hostused => $hostused,
+		hostcpu => $d->{hostcpu},
 	    };
 	} else {
 	    $d->{cpu} = $old->{cpu};
+	    $d->{hostcpu} = $old->{hostcpu};
 	}
     }
 
-- 
2.20.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value
  2020-11-04  1:41 [pve-devel] [PATCH qemu-server 0/3] vmstatus: add pressure + hostcpu/hostmem Alexandre Derumier
  2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 1/3] vmstatus: add hostcpu value Alexandre Derumier
@ 2020-11-04  1:41 ` Alexandre Derumier
  2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 3/3] vmstatus: add pressure stats Alexandre Derumier
  2 siblings, 0 replies; 6+ messages in thread
From: Alexandre Derumier @ 2020-11-04  1:41 UTC (permalink / raw)
  To: pve-devel

---
 PVE/QemuServer.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0c2b1db..64d3635 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2658,6 +2658,11 @@ sub vmstatus {
 	if ($pstat->{vsize}) {
 	    $d->{mem} = int(($pstat->{rss}/$pstat->{vsize})*$d->{maxmem});
 	}
+	if (defined(my $hostmemstat = $cgroups->get_memory_stat())) {
+	    $d->{hostmem} = $hostmemstat->{mem};
+	} else {
+	    $d->{hostmem} = 0;
+	}
 
 	my $old = $last_proc_pid_stat->{$pid};
 	if (!$old) {
-- 
2.20.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH qemu-server 3/3] vmstatus: add pressure stats
  2020-11-04  1:41 [pve-devel] [PATCH qemu-server 0/3] vmstatus: add pressure + hostcpu/hostmem Alexandre Derumier
  2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 1/3] vmstatus: add hostcpu value Alexandre Derumier
  2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value Alexandre Derumier
@ 2020-11-04  1:41 ` Alexandre Derumier
  2 siblings, 0 replies; 6+ messages in thread
From: Alexandre Derumier @ 2020-11-04  1:41 UTC (permalink / raw)
  To: pve-devel

---
 PVE/QemuServer.pm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 64d3635..f1b778e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2696,6 +2696,24 @@ sub vmstatus {
 	    $d->{cpu} = $old->{cpu};
 	    $d->{hostcpu} = $old->{hostcpu};
 	}
+
+	if (defined(my $pressure = $cgroups->get_pressure_stat())) {
+            $d->{pressure} = $pressure;
+	} else {
+	    $d->{pressure} = {
+		cpu => {
+		    some => { avg10 => 10, avg60 => 0, avg300 => 0 }
+		},
+		memory => {
+		    some => { avg10 => 10, avg60 => 0, avg300 => 0 },
+		    full => { avg10 => 10, avg60 => 0, avg300 => 0 }
+		},
+		io => {
+		    some => { avg10 => 10, avg60 => 0, avg300 => 0 },
+		    full => { avg10 => 10, avg60 => 0, avg300 => 0 }
+		},
+	    };
+        }
     }
 
     return $res if !$full;
-- 
2.20.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value
  2022-06-01  8:12 [pve-devel] [PATCH-SERIES common/qemu-server/lxc/manager] brodcast new metric stats in kvstore Alexandre Derumier
@ 2022-06-01  8:12 ` Alexandre Derumier
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Derumier @ 2022-06-01  8:12 UTC (permalink / raw)
  To: pve-devel; +Cc: t.lamprecht, Alexandre Derumier

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 PVE/QemuServer.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 9441cf2..4fc183e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2933,6 +2933,11 @@ sub vmstatus {
 	if ($pstat->{vsize}) {
 	    $d->{mem} = int(($pstat->{rss}/$pstat->{vsize})*$d->{maxmem});
 	}
+	if (defined(my $hostmemstat = $cgroups->get_memory_stat())) {
+	    $d->{hostmem} = $hostmemstat->{mem};
+	} else {
+	    $d->{hostmem} = 0;
+	}
 
 	my $old = $last_proc_pid_stat->{$pid};
 	if (!$old) {
-- 
2.30.2




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value
  2022-05-25  6:52 [pve-devel] [PATCH-SERIES cluster/common/qemu-server/lxc/manager] add new metric stats in single rrd Alexandre Derumier
@ 2022-05-25  6:52 ` Alexandre Derumier
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Derumier @ 2022-05-25  6:52 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 PVE/QemuServer.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 9441cf2..4fc183e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2933,6 +2933,11 @@ sub vmstatus {
 	if ($pstat->{vsize}) {
 	    $d->{mem} = int(($pstat->{rss}/$pstat->{vsize})*$d->{maxmem});
 	}
+	if (defined(my $hostmemstat = $cgroups->get_memory_stat())) {
+	    $d->{hostmem} = $hostmemstat->{mem};
+	} else {
+	    $d->{hostmem} = 0;
+	}
 
 	my $old = $last_proc_pid_stat->{$pid};
 	if (!$old) {
-- 
2.30.2




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-01  8:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  1:41 [pve-devel] [PATCH qemu-server 0/3] vmstatus: add pressure + hostcpu/hostmem Alexandre Derumier
2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 1/3] vmstatus: add hostcpu value Alexandre Derumier
2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value Alexandre Derumier
2020-11-04  1:41 ` [pve-devel] [PATCH qemu-server 3/3] vmstatus: add pressure stats Alexandre Derumier
2022-05-25  6:52 [pve-devel] [PATCH-SERIES cluster/common/qemu-server/lxc/manager] add new metric stats in single rrd Alexandre Derumier
2022-05-25  6:52 ` [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value Alexandre Derumier
2022-06-01  8:12 [pve-devel] [PATCH-SERIES common/qemu-server/lxc/manager] brodcast new metric stats in kvstore Alexandre Derumier
2022-06-01  8:12 ` [pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value Alexandre Derumier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal