Skip to content

Fix Display CPU in mCPU and add 2-decimal memory precision in cards. - #70

Merged
Annonnymmousss merged 1 commit into
developfrom
fix/card-mcpu-and-memory-precision
Aug 20, 2026
Merged

Annonnymmousss merged 1 commit into
developfrom
fix/card-mcpu-and-memory-precision

Conversation

@Weaver1209

Copy link
Copy Markdown

Description

This PR improves metric visibility and precision on the Container Health Dashboard cards for lightweight/static user containers:

  • CPU Metrics: Switched CPU metric unit from percentage to millicores (mCPU where 1% = 10 mCPU) with 2 decimal places so low-utilization
    containers display meaningful numbers instead of 0.00%.
  • Prometheus Query: Updated CPU Prometheus queries from rate() to irate() to capture instantaneous CPU bursts rather than diluting short activity
    across a 60-second window.
  • Memory Precision: Updated memory rounding in the backend and frontend to 2 decimal places (MB).

Related Issue

Closes #69

Visual Demonstration (After)

screenrecording-2026-08-20_21-09-22.mp4

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Container Health Dashboard metrics pipeline to improve visibility for low-usage containers by changing CPU display units to millicores and increasing memory precision to 2 decimals, while also switching CPU Prometheus queries to irate() for more burst-sensitive readings.

Changes:

  • Display CPU on dashboard cards as mCPU with 2-decimal formatting (frontend).
  • Switch CPU Prometheus queries from rate() to irate() for both summary and history queries (backend).
  • Round and display memory usage in MB to 2-decimal precision in both API responses and the UI.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/frontend/src/components/ContainerHealth.vue Updates CPU card display to mCPU and formats memory usage to 2 decimals.
src/backend/utils/container-health.ts Switches CPU Prometheus queries to irate() for current stats and history.
src/backend/health-api.ts Rounds memory usage values to 2 decimals in health and metrics API responses.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/frontend/src/components/ContainerHealth.vue
Comment thread src/backend/utils/container-health.ts
@Annonnymmousss

Annonnymmousss commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

LGTM!!

@Weaver1209 Do GPG signing please, you don't have a verified commit at this stage. As the work is urgent I am ignoring it and merging from next time it should not be same.

And PR title should not need to be exactly commit message format. We generally dont use the same convention because title need to be more crisp. Also cuts the end of title and show .... which is ofc not good. Keep all these comments in mind.

@Annonnymmousss Annonnymmousss changed the title fix(health): display CPU in mCPU and add 2-decimal memory precision o… Fix Display CPU in mCPU and add 2-decimal memory precision in cards. Aug 20, 2026
@Annonnymmousss
Annonnymmousss merged commit 9145073 into develop Aug 20, 2026
2 checks passed
@Annonnymmousss
Annonnymmousss deleted the fix/card-mcpu-and-memory-precision branch August 20, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants