Skip to content

Conversation

@nowgnuesLee
Copy link
Contributor

@nowgnuesLee nowgnuesLee commented Nov 17, 2025

resolves #4614 (FR-1666)

This PR fixes CPU utilization calculation in several components:

  1. In AgentList.tsx, updated the CPU utilization ratio calculation to use the percentage value directly from the node data and properly handle division by zero.

  2. In SessionSlotCell.tsx, improved the CPU usage display by:

    • Using more descriptive variable names
    • Adding proper bounds checking with Math.min
    • Ensuring the percentage calculation is correctly capped at 100%
  3. In SessionUsageMonitor.tsx, applied similar improvements to ensure CPU utilization is properly calculated and displayed, with appropriate upper bounds.

Checklist: (if applicable)

  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

@github-actions github-actions bot added the size:M 30~100 LoC label Nov 17, 2025
Copy link
Contributor Author

nowgnuesLee commented Nov 17, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nowgnuesLee nowgnuesLee marked this pull request as ready for review November 17, 2025 05:52
@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 4.68% 547/11676
🔴 Branches 3.82% 314/8227
🔴 Functions 2.91% 104/3577
🔴 Lines 4.63% 529/11417

Test suite run success

125 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 1b47b77

@graphite-app graphite-app bot changed the base branch from feat/add-more-agent-stat-types to graphite-base/4648 November 18, 2025 08:08
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

LGTM

@yomybaby yomybaby force-pushed the feat/clamp-cpu-live-stats branch from d013e0b to 5d92a85 Compare November 18, 2025 09:54
@yomybaby yomybaby changed the base branch from graphite-base/4648 to main November 18, 2025 09:54
@graphite-app
Copy link

graphite-app bot commented Nov 18, 2025

Merge activity

…4648)

resolves #4614 (FR-1666)

This PR fixes CPU utilization calculation in several components:

1. In `AgentList.tsx`, updated the CPU utilization ratio calculation to use the percentage value directly from the node data and properly handle division by zero.

2. In `SessionSlotCell.tsx`, improved the CPU usage display by:
   - Using more descriptive variable names
   - Adding proper bounds checking with `Math.min`
   - Ensuring the percentage calculation is correctly capped at 100%

3. In `SessionUsageMonitor.tsx`, applied similar improvements to ensure CPU utilization is properly calculated and displayed, with appropriate upper bounds.

**Checklist:** (if applicable)

- [ ] Documentation
- [ ] Minium required manager version
- [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
- [ ] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
@graphite-app graphite-app bot force-pushed the feat/clamp-cpu-live-stats branch from 5d92a85 to 1b47b77 Compare November 18, 2025 09:55
@graphite-app graphite-app bot merged commit 1b47b77 into main Nov 18, 2025
11 checks passed
@graphite-app graphite-app bot deleted the feat/clamp-cpu-live-stats branch November 18, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clamp CPU live stats to the theoretical maximum range

3 participants