[pve-devel] [PATCH qemu-server 3/3] vmstatus: add pressure stats

Alexandre Derumier aderumier at odiso.com
Wed Nov 4 02:41:44 CET 2020


---
 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





More information about the pve-devel mailing list