From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common 2/2] add functions to retrieve pressures for vm/ct
Date: Wed, 9 Jul 2025 13:22:57 +0200 [thread overview]
Message-ID: <20250709112309.2299797-8-a.lauterer@proxmox.com> (raw)
In-Reply-To: <20250709112309.2299797-1-a.lauterer@proxmox.com>
From: Folke Gleumes <f.gleumes@proxmox.com>
Originally-by: Folke Gleumes <f.gleumes@proxmox.com>
[AL:
rebased on current master
merged into single function for generic cgroups
]
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
Notes:
while the read_cgroup_pressure function would fit better into
SysFSTools.pm I have kept it in ProcFSTools.pm for now, mainly because
we currently don't use ProcFSTools in SysFSTools, and the actual
function to parse the contents of the pressure files in in ProcFSTools.
If that would not be an issue, we could also move the
read_cgroup_pressure function to SysFSTools
changes since
RFC:
* instead of dedicated functions for CTs and VMs we use a more generic
for cgroups in general
src/PVE/ProcFSTools.pm | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index f342890..f28372b 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -151,6 +151,17 @@ sub parse_pressure {
return $res;
}
+sub read_cgroup_pressure {
+ my ($cgroup_path) = @_;
+
+ my $res = {};
+ for my $type (qw(cpu memory io)) {
+ my $stats = parse_pressure("sys/fs/cgroup/${cgroup_path}/${type}.pressure");
+ $res->{$type} = $stats if $stats;
+ }
+ return $res;
+}
+
sub read_pressure {
my $res = {};
foreach my $type (qw(cpu memory io)) {
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-07-09 11:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 11:22 [pve-devel] [PATCH many 00/19] Expand and migrate RRD data (excluding GUI) Aaron Lauterer
2025-07-09 11:22 ` [pve-devel] [PATCH cluster-pve8 1/1] status: handle new metrics update data Aaron Lauterer
2025-07-09 11:22 ` [pve-devel] [PATCH pve9-rrd-migration-tool 1/1] introduce rrd migration tool for pve8 -> pve9 Aaron Lauterer
2025-07-09 11:22 ` [pve-devel] [PATCH cluster 1/3] cfs status.c: drop old pve2-vm rrd schema support Aaron Lauterer
2025-07-09 11:22 ` [pve-devel] [PATCH cluster 2/3] status: handle new pve9- metrics update data Aaron Lauterer
2025-07-09 11:22 ` [pve-devel] [PATCH cluster 3/3] status: introduce new pve9- rrd and metric format Aaron Lauterer
2025-07-09 11:22 ` [pve-devel] [PATCH common 1/2] fix error in pressure parsing Aaron Lauterer
2025-07-09 11:22 ` Aaron Lauterer [this message]
2025-07-09 11:22 ` [pve-devel] [PATCH manager 1/5] api2tools: drop old VM rrd schema Aaron Lauterer
2025-07-09 11:22 ` [pve-devel] [PATCH manager 2/5] api2tools: extract stats: handle existence of new pve-{type}-9.0 data Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH manager 3/5] pvestatd: collect and distribute new pve-{type}-9.0 metrics Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH manager 4/5] api: nodes: rrd and rrddata add decade option and use new pve-node-9.0 rrd files Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH manager 5/5] api2tools: extract_vm_status add new vm memhost column Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH storage 1/1] status: rrddata: use new pve-storage-9.0 rrd location if file is present Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH qemu-server 1/4] metrics: add pressure to metrics Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH qemu-server 2/4] vmstatus: add memhost for host view of vm mem consumption Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH qemu-server 3/4] vmstatus: switch mem stat to PSS of VM cgroup Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH qemu-server 4/4] rrddata: use new pve-vm-9.0 rrd location if file is present Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH container 1/2] metrics: add pressures to metrics Aaron Lauterer
2025-07-09 11:23 ` [pve-devel] [PATCH container 2/2] rrddata: use new pve-vm-9.0 rrd location if file is present Aaron Lauterer
2025-07-09 16:40 ` [pve-devel] [PATCH many 00/19] Expand and migrate RRD data (excluding GUI) Aaron Lauterer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250709112309.2299797-8-a.lauterer@proxmox.com \
--to=a.lauterer@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox