mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-26 13:39:47 +00:00
c0948cf792
Proxmox's `/cluster/resources` `mem` for a container is its cgroup usage with page cache already subtracted (`PVE::CGroup::get_memory_stat`: `memory.current - memory.stat file` on cgroup v2, `usage_in_bytes - total_cache` on v1). #3011 makes the backend read it as known pressure for containers. The frontend still listed `cluster-resources` as cache-inclusive for every guest, so the container drawer said the reading "may include cached memory the container can reuse" and appended agent setup advice. - `memoryObservation.ts` classifies `cluster-resources` by guest kind: cache-excluded for a container, cache-inclusive for a QEMU guest or a guest of unknown kind. The other Proxmox fallbacks are unchanged. - The canonical resource drawer (`resourceDetailDrawerMetricsHistoryModel.ts`) now passes the guest kind, so it qualifies the same reading the same way. A retained VM reading there also gets the VM wording the Workloads drawer already uses. - The frontend-primitives contract clause that said a container's Proxmox reading always carries the caveat is corrected. Tests: the new container cases in `memoryObservation.test.ts`, `GuestDrawerOverview.memory-cache.test.tsx`, `GuestRow.test.tsx` and `resourceDetailDrawerMetricsHistoryModel.branchcov0712.test.ts` fail against main's source (6 failures) and pass with the fix. Existing container-copy tests now use `status-mem`, which is still cache-inclusive. Browser pass: private mock backend built from main. Before the fix, LXC `auth-service-01` (`cluster-resources`) showed `Current · Proxmox (may include cache)` and an `About this reading` note. After the fix it shows `Current · Proxmox` with no note. A QEMU drawer keeps its caveat. Checked at 1440 and 390 px wide. Refs #2762