Conversation
- Implement cgroupmon monitor with 17 metrics across CPU, memory, I/O, and process counts - Support automatic detection of cgroup v1, v2, and hybrid environments - Parse cgroup controllers: cpu.stat, memory.stat, io.stat for both versions - Integrate with prmon build system and test infrastructure - Add Python and GTest test harnesses with precooked cgroup v2 fixtures - Update documentation: README, ADDING_MONITORS, CONTRIBUTING with usage and Windows dev notes - Enable container resource tracking with --disable cgroupmon flag - Provide more accurate I/O statistics for containerized workloads
…ead counting - Remove unused cgroup_stat_update variable in update_stats() - Fix read_single_value() to count lines for cgroup.procs and cgroup.threads instead of reading first value, since these are multi-line PID lists
|
Thanks a lot for the PR @DhanashreePetare. Before we go further, I’d like to better understand the motivation and concrete use cases behind this change. The PR adds a fairly substantial amount of new code, and as maintainers we try to be cautious about introducing functionality unless there’s a clear and compelling need, since it also increases the long-term maintenance burden. Could you elaborate a bit on the scenarios this is meant to support, and whether there are existing users or workflows that would benefit from it? That context would really help us evaluate how to move forward. |
|
Thanks for the thoughtful review and for asking about motivation. This PR is aimed at containerized and scheduler‑managed workloads where Concrete scenarios this helps:
The implementation is automatic and safe: it detects v1/v2/hybrid, gracefully degrades when cgroups are absent, and can be disabled with It would be great to hear on it, and I’m happy to adjust further implementation/changes if required based on maintainer's guidance. |
|
Hello @DhanashreePetare thank you for the explanations. @amete and I will look in more detail at the code and get back to you. |
Cgroup v1/v2 Monitoring Support
Overview
Adds comprehensive cgroup (container) resource monitoring to prmon with automatic detection of cgroup v1, v2, and hybrid environments.
Changes
cgroupmonwith 17 metrics across CPU, memory, I/O, and process countscpu.stat,memory.stat,io.statfor both v1 and v2--disable cgroupmonif neededBenefits
Testing
Python linting passes. CI will verify build and tests in Linux environments.