Skip to content

Commit

Permalink
fix cpu usage compute
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Sep 8, 2023
1 parent fb4bed1 commit b643e5d
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions assets/src/components/cluster/nodes/NodesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,28 @@ const ColZone = columnHelper.accessor((row) => row.zone, {
header: 'Zone',
})

const ColCpuUsage = columnHelper.accessor((row) => row?.cpu.used / row?.cpu.total, {
id: 'cpu-usage',
enableSorting: true,
sortingFn: numishSort,
cell: (props) => (
<Tooltip
label={`${rounded(props.getValue())}%`}
placement="top"
>
<TableText>
<UsageBar
usage={props.getValue()}
width={120}
/>
</TableText>
</Tooltip>
),
header: 'CPU usage',
})
const ColCpuUsage = columnHelper.accessor(
(row) => (row?.cpu?.used ?? 0) / (row?.cpu?.total ?? 1),
{
id: 'cpu-usage',
enableSorting: true,
sortingFn: numishSort,
cell: (props) => (
<Tooltip
label={`${rounded(props.getValue())}%`}
placement="top"
>
<TableText>
<UsageBar
usage={props.getValue()}
width={120}
/>
</TableText>
</Tooltip>
),
header: 'CPU usage',
}
)

const ColMemoryUsage = columnHelper.accessor(
(row) => (row?.memory?.used ?? 0) / (row?.memory?.total ?? 1),
Expand Down

0 comments on commit b643e5d

Please sign in to comment.