feat: show swap usage in monitoring#4574
Open
agentHits wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
This PR adds optional swap usage visibility to the free Monitoring page's Memory Usage card. When swap data is available, the card now shows a second progress bar below the existing memory bar so users can see both RAM usage and swap usage at a glance.
The backend stores swap usage alongside the existing memory stats without changing the existing RAM fields, so older monitoring entries without swap data remain compatible. It uses
node-os-utilsswap data when available and falls back tosysctl -n vm.swapusageon macOS, wherenode-os-utilscan report0B / 0Beven when macOS has active swap.The UI only renders the Swap row when the reported swap total is greater than zero, keeping the current card unchanged on systems without swap.
Checklist
Before submitting this PR, please make sure that:
canarybranch.Testing
corepack pnpm --dir apps/dokploy exec vitest --config __test__/vitest.config.ts __test__/monitoring/memory-swap.test.ts --runcorepack pnpm exec biome check apps/dokploy/__test__/monitoring/memory-swap.test.ts apps/dokploy/components/dashboard/monitoring/free/container/show-free-container-monitoring.tsx apps/dokploy/components/dashboard/monitoring/free/container/docker-memory-chart.tsx packages/server/src/monitoring/utils.tscorepack pnpm --filter=server run typecheckcorepack pnpm --filter=dokploy run typecheckgit diff --checkhttp://localhost:3000/dashboard/monitoringwith swap displayed in the Memory Usage card.Issues related (if applicable)
N/A
Screenshots (if applicable)