From 17e1525830f185ed6174b5e57f8fbdca1eaaac36 Mon Sep 17 00:00:00 2001 From: rcourtman <8825017+rcourtman@users.noreply.github.com> Date: Sat, 17 Oct 2026 00:28:13 +0100 Subject: [PATCH] Stop calling an LXC's Proxmox listing memory cache-inclusive Proxmox's /cluster/resources mem for a container is its cgroup usage with page cache already subtracted (PVE::CGroup::get_memory_stat: memory.current minus memory.stat file on cgroup v2, usage_in_bytes minus total_cache on v1). The backend now reads it as known pressure for containers, but the frontend classification still listed cluster-resources as cache-inclusive for every guest, so the container drawer told users the reading "may include cached memory the container can reuse" and appended setup advice. Make the classification guest-kind aware the same way: a container's cluster-resources reading is cache-excluded, while a QEMU guest's (or one of unknown kind) keeps the caveat. The canonical resource drawer now passes the guest kind too, so it qualifies the same reading the same way. --- .../subsystems/frontend-primitives.md | 15 ++++--- .../96fbcd34c5046364.json | 39 ++++++++++++++++++ ...rMetricsHistoryModel.branchcov0712.test.ts | 12 ++++++ ...resourceDetailDrawerMetricsHistoryModel.ts | 10 +++++ .../GuestDrawerOverview.memory-cache.test.tsx | 16 +++++++- .../Workloads/__tests__/GuestRow.test.tsx | 26 +++++++++++- .../utils/__tests__/memoryObservation.test.ts | 41 ++++++++++++++++++- .../src/utils/memoryObservation.ts | 13 +++++- 8 files changed, 159 insertions(+), 13 deletions(-) create mode 100644 frontend-modern/browser-verification/96fbcd34c5046364.json diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md index 0ca824b116..681caca931 100644 --- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md +++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md @@ -243,8 +243,9 @@ An independent qualified memory reading is not paused by a disk deferral. Neither Last seen, backup completion nor running power state renews memory. Unannotated unrelated platforms and actual zero readings retain their meaning. A current reading from a cache-inclusive Proxmox source (`status-mem`, -`status-freemem`, `cluster-resources`, `derived-total-minus-used`, the same set -the backend marks `MayIncludeCache`) keeps its numbers, colour and thresholds; +`status-freemem`, `cluster-resources`, `derived-total-minus-used`, the same +sources and guest kinds the backend marks `MayIncludeCache`) keeps its numbers, +colour and thresholds; the shared presentation adds `mayIncludeCache` and a `cacheNote` saying a high percentage alone does not show memory pressure and which fix can supply the guest's own figure. A VM row shows `May include cache` (`Cache?` in compact @@ -252,9 +253,13 @@ layouts) only while the guest's own memory meets its warning or critical threshold, the figure that colours the bar in host-share mode too, which is when a cache-inclusive figure reads as pressure; below that the caveat is the cell title, the chart's native hover title and assistive text, not a label on every -agentless VM. A container, whose Proxmox reading is always the cgroup value, -keeps the caveat in the bar tooltip and drawer instead of a label on every -row. A retained or freshness-unknown reading keeps its own freshness label +agentless VM. A container's `cluster-resources` reading is not +cache-inclusive: Proxmox subtracts page cache from the cgroup usage +(`PVE::CGroup::get_memory_stat`) before it reaches `/cluster/resources`, so +`memoryObservation.ts` classifies that source by guest kind and neither row, +tooltip nor drawer qualifies it. A QEMU guest, or a guest of unknown kind, +keeps the caveat for it. Any other cache-inclusive container reading keeps the +caveat in the bar tooltip and drawer instead of a label on every row. A retained or freshness-unknown reading keeps its own freshness label with the caveat in its explanation, an unavailable reading is never qualified, and the drawer states the note as visible text in `About this reading`. An unavailable explanation names only what is known: a powered-off guest reads diff --git a/frontend-modern/browser-verification/96fbcd34c5046364.json b/frontend-modern/browser-verification/96fbcd34c5046364.json new file mode 100644 index 0000000000..ad43a52c08 --- /dev/null +++ b/frontend-modern/browser-verification/96fbcd34c5046364.json @@ -0,0 +1,39 @@ +{ + "version": 1, + "base_sha": "6aef85ac88e3fcb812388c52fa92842a6ef278f5", + "verified_at": "2026-10-16T23:27:30Z", + "result": "passed", + "changed_paths": [ + "frontend-modern/src/components/Infrastructure/resourceDetailDrawerMetricsHistoryModel.ts", + "frontend-modern/src/utils/memoryObservation.ts" + ], + "content_sha256": { + "frontend-modern/src/components/Infrastructure/resourceDetailDrawerMetricsHistoryModel.ts": "6d3917fdd33adf43199becfcb2fc0e32e14c3d282bebefaf3566e586b6feb83d", + "frontend-modern/src/utils/memoryObservation.ts": "692666d2a7dbee34ecabde32aac5c4ad226282f96e95feb210b1a69d87a14bdd" + }, + "routes": [ + "/proxmox" + ], + "viewports": [ + { + "width": 1440, + "height": 900 + }, + { + "width": 390, + "height": 844 + } + ], + "states": [ + "private mock backend built from origin/main; LXC auth-service-01 with a current cluster-resources memory observation", + "before (main's memoryObservation.ts): container drawer Details read 'Current · Proxmox (may include cache)' and showed 'About this reading' saying cached memory the container can reuse", + "after: container drawer Details read 'Current · Proxmox ·