[pve-devel] [PATCH V2 pve-container] vmstatus: add pressure stats

Alexandre Derumier aderumier at odiso.com
Sun Feb 7 14:41:24 CET 2021


Signed-off-by: Alexandre Derumier <aderumier at 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





More information about the pve-devel mailing list