Skip to content

feat: show swap usage in monitoring#4574

Open
agentHits wants to merge 1 commit into
Dokploy:canaryfrom
agentHits:feat/monitoring-swap-usage
Open

feat: show swap usage in monitoring#4574
agentHits wants to merge 1 commit into
Dokploy:canaryfrom
agentHits:feat/monitoring-swap-usage

Conversation

@agentHits

Copy link
Copy Markdown

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-utils swap data when available and falls back to sysctl -n vm.swapusage on macOS, where node-os-utils can report 0B / 0B even 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:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Testing

  • corepack pnpm --dir apps/dokploy exec vitest --config __test__/vitest.config.ts __test__/monitoring/memory-swap.test.ts --run
  • corepack 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.ts
  • corepack pnpm --filter=server run typecheck
  • corepack pnpm --filter=dokploy run typecheck
  • git diff --check
  • Tested locally at http://localhost:3000/dashboard/monitoring with swap displayed in the Memory Usage card.

Issues related (if applicable)

N/A

Screenshots (if applicable)

Monitoring swap usage

@agentHits agentHits marked this pull request as ready for review June 8, 2026 13:34
@agentHits agentHits requested a review from Siumauricio as a code owner June 8, 2026 13:34
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant