-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Session usage monitor in react #2814
base: main
Are you sure you want to change the base?
Conversation
Your org requires the Graphite merge queue for merging into mainAdd the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🔴 | Statements | 5.26% (-0.02% 🔻) |
395/7503 |
🔴 | Branches | 4.54% (-0.04% 🔻) |
237/5220 |
🔴 | Functions | 3.15% (-0.01% 🔻) |
78/2475 |
🔴 | Lines | 5.18% (-0.02% 🔻) |
380/7331 |
Show new covered files 🐣
St.❔ |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
🔴 | ... / SessionUsageMonitor.tsx |
0% | 0% | 0% | 0% |
Test suite run success
124 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from a1bc1c6
3a48b36
to
8358664
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8358664
to
63bd1b2
Compare
63bd1b2
to
e85e6a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
</Row> | ||
<Flex justify="end" style={{ width: '100%' }}> | ||
<Typography.Text> | ||
{`I/O Read: ${iSizeToSize(sortedLiveStat?.io_read?.current, 'g')?.numberUnit}B / Write: ${iSizeToSize(sortedLiveStat?.io_write?.current, 'g')?.numberUnit}B`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The iSizeToSize function is for binary size conversion, not for I/O. Please check the original version and ensure that the display matches it. See the reference here: https://github.com/lablup/backend.ai-webui/blob/main/src/components/backend-ai-session-list.ts#L4318-L4326
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that code, the API request value comes in as a MB value, but not in ComputeSessionNode, so I modified it to show it in MB, the same as the session list usage column, using convertDecimalSizeUnit
.
const resourceTypeMap: { | ||
[key in acceleratorType | 'cpu' | 'mem']: string; | ||
} = { | ||
cpu: 'cpu', | ||
mem: 'mem', | ||
cuda: 'cuda.device', | ||
rocm: 'rocm.device', | ||
tpu: 'tpu.device', | ||
ipu: 'ipu.device', | ||
atom: 'atom.device', | ||
'atom-plus': 'atom-plus.device', | ||
gaudi2: 'gaudi2.device', | ||
warboy: 'warboy.device', | ||
rngd: 'rngd.device', | ||
'hyperaccel-lpu': 'hyperaccel-lpu.device', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to create a function to add device
without using hardcoded accelerator names.
{_.map(sortedLiveStat, (value, key) => { | ||
const device = key.split('_')?.[0] as keyof typeof resourceTypeMap; | ||
|
||
return _.includes( | ||
_.keysIn(_.omit(resourceTypeMap, 'cpu', 'mem')), | ||
device, | ||
) ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's refactor this part. filter
(or pickBy) first and map later.
e85e6a4
to
87e4942
Compare
87e4942
to
a1bc1c6
Compare
This PR resolves #2803 issue.
Changes:
How to test:
Checklist: (if applicable)