fix(PCI and VM Usage) fixes for PCI speed and VM usage cpu reporting.#2636
fix(PCI and VM Usage) fixes for PCI speed and VM usage cpu reporting.#2636SimonFair wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR refactors VM usage sampling to use timestamps and absolute-counter deltas (host and optional guest vCPU times), makes disk/network rates interval-aware and computes an adjusted RX rate, adds PCIe link parsing and ancestor-fallback logic for more accurate endpoint reporting (special-casing Intel GPUs/misreports), removes a redundant VM-settings reboot AJAX call, and fixes a libvirt error-check path. UI publishing/display of rates now uses raw collected rates (no timer scaling). ChangesVM usage sampling and deltas
PCIe Link Detection Enhancement
UI publish/display consistency
Libvirt error handling
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php`:
- Around line 2804-2806: The current logic sets $currentmem to 0 when
balloon.current is missing, causing meminuse to be clamped to 0; change the
fallback so $currentmem uses balloon.maximum if balloon.current is not provided,
and if neither limit exists, allow RSS to be used directly. Concretely, update
the computation around $currentmem/$maximummem/$meminuse in libvirt_helpers.php
so $currentmem = (int)($data['balloon.current'] ?? $data['balloon.maximum'] ??
0) (or equivalent), then compute $meminuse from min($rss, $currentmem) but if
$currentmem is 0 use $rss directly; reference the variables $currentmem,
$maximummem, $meminuse and the $data['balloon.rss'] / $data['balloon.maximum']
entries when making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4244794b-bf26-4be3-a664-0a40e1aa8907
📒 Files selected for processing (4)
emhttp/plugins/dynamix.vm.manager/include/libvirt.phpemhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.phpemhttp/plugins/dynamix.vm.manager/nchan/vm_usageemhttp/plugins/dynamix/nchan/vm_dashusage
✅ Files skipped from review due to trivial changes (1)
- emhttp/plugins/dynamix.vm.manager/nchan/vm_usage
For Intel gpus look up the pci tree to get speed for Intel ARC gpus which lspci reports as x1
Refine CPU calculation for VM usage.
Consistent VM disk and network rate reporting (no unintended scaling), including adjusted RX rate metric.
Remove VM reboot message as managed by boot parameters now.
Summary by CodeRabbit