all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH V2 pve-container] vmstatus: add pressure stats
@ 2021-02-07 13:41 Alexandre Derumier
  0 siblings, 0 replies; only message in thread
From: Alexandre Derumier @ 2021-02-07 13:41 UTC (permalink / raw)
  To: pve-devel

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

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index bae236b..d0e4b79 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -297,6 +297,24 @@ sub vmstatus {
 	} else {
 	    $d->{cpu} = 0;
 	}
+
+	if (defined(my $pressure = $cgroups->get_pressure_stat())) {
+	    $d->{pressure} = $pressure;
+	} else {
+	    $d->{pressure} = {
+		cpu => {
+		    some => { avg10 => 0, avg60 => 0, avg300 => 0 }
+		},
+		memory => {
+		    some => { avg10 => 0, avg60 => 0, avg300 => 0 },
+		    full => { avg10 => 0, avg60 => 0, avg300 => 0 }
+		},
+		io => {
+		    some => { avg10 => 0, avg60 => 0, avg300 => 0 },
+		    full => { avg10 => 0, avg60 => 0, avg300 => 0 }
+		},
+	    };
+	}
     }
 
     my $netdev = PVE::ProcFSTools::read_proc_net_dev();
-- 
2.20.1




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-07 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-07 13:41 [pve-devel] [PATCH V2 pve-container] vmstatus: add pressure stats 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