[pve-devel] [PATCH pve-container 1/1] vmstatus: add pressure stats
Alexandre Derumier
aderumier at odiso.com
Wed Nov 4 02:42:05 CET 2020
---
src/PVE/LXC.pm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 5cfcf28..ad1460c 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -291,6 +291,24 @@ sub vmstatus {
} else {
$d->{cpu} = 0;
}
+
+ 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 }
+ },
+ };
+ }
}
my $netdev = PVE::ProcFSTools::read_proc_net_dev();
--
2.20.1
More information about the pve-devel
mailing list