Re: [pve-devel] [PATCH pve-manager 2/3] Fix #5708: Add CPU raw counters

2024-10-01 Thread Sascha Westermann via pve-devel
--- Begin Message --- If the data is also to be processed by external metric servers, I think the integration in `PVE::ProcFSTools::read_proc_stat()` makes sense. The term `cpustat` would no longer conflict in this case, as the content would be virtually the same. I would create a new patch series

[pve-devel] [PATCH pve-common/pve-manager/qemu-server 0/3] Fix #5708: Add CPU raw counters

2024-09-19 Thread Sascha Westermann via pve-devel
--- Begin Message --- To monitor the CPU utilization of nodes and Qemu VMs at arbitrary intervals (e.g. every 30 seconds) via the Proxmox API, there are no suitable endpoints right now: /api2/json/nodes/{node}/status (cpu): Instant value /api2/json/nodes/{node}/rrddata?timeframe=hour (cpu): Averag

[pve-devel] [PATCH pve-common 1/3] Fix #5708: Add CPU raw counters

2024-09-19 Thread Sascha Westermann via pve-devel
--- Begin Message --- Add "guest_time" (43) from /proc//stat. Signed-off-by: Sascha Westermann --- src/PVE/ProcFSTools.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm index 3826fcc..5b0062e 100644 --- a/src/PVE/ProcFSTools.

[pve-devel] [PATCH pve-manager 2/3] Fix #5708: Add CPU raw counters

2024-09-18 Thread Sascha Westermann via pve-devel
--- Begin Message --- Add a map containing raw values from /proc/stat and "uptime_ticks" which can be used in combination with cpuinfo.user_hz to calculate CPU usage from two samples. "uptime_ticks" is only defined at the top level, as /proc/stat is read once, so that core-specific raw values match

[pve-devel] [PATCH qemu-server 3/3] Fix #5708: Add CPU raw counters

2024-09-18 Thread Sascha Westermann via pve-devel
--- Begin Message --- Add a map containing raw values from /proc//stat (utime, stime and guest_time), "uptime_ticks" and "user_hz" (from cpuinfo) to calcuate physical CPU usage from two samples. In addition, virtual CPU statistics based on /proc//task//schedstat ( for virtual cores) are added - bas