Skip to content

Commit

Permalink
fix(portal-web): 仪表盘cpu和gpu利用率百分比显示错误 (#1153)
Browse files Browse the repository at this point in the history
## 百分比少乘了100
  • Loading branch information
OYX-1 authored Mar 4, 2024
1 parent e581639 commit 0ad604c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-apricots-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/portal-web": patch
---

仪表盘 cpu 和 gpu 利用率百分比显示错误
4 changes: 2 additions & 2 deletions apps/portal-web/src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export const DashboardPage: NextPage<Props> = requireAuth(() => true)(() => {
cluster.clusterInfo.partitions.map((x) => ({
clusterName: cluster.clusterInfo.clusterName,
...x,
cpuUsage:(x.runningCpuCount / x.cpuCoreCount).toFixed(2),
cpuUsage:((x.runningCpuCount / x.cpuCoreCount) * 100).toFixed(2),
// 有些分区没有gpu就为空,前端显示'-'
...x.gpuCoreCount ? { gpuUsage:(x.runningGpuCount / x.gpuCoreCount).toFixed(2) } : {},
...x.gpuCoreCount ? { gpuUsage:((x.runningGpuCount / x.gpuCoreCount) * 100).toFixed(2) } : {},
})),
);

Expand Down

0 comments on commit 0ad604c

Please sign in to comment.