Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/components/nodesColumns/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,12 @@ export function getCpuColumn<
sortAccessor: ({PoolStats = []}) => Math.max(...PoolStats.map(({Usage}) => Number(Usage))),
defaultOrder: DataTable.DESCENDING,
render: ({row}) => {
if (!row.PoolStats) {
return EMPTY_DATA_PLACEHOLDER;
}

let totalPoolUsage =
isNumeric(row.CoresUsed) && isNumeric(row.CoresTotal)
? row.CoresUsed / row.CoresTotal
: undefined;

if (totalPoolUsage === undefined) {
if (totalPoolUsage === undefined && row.PoolStats) {
let totalThreadsCount = 0;
totalPoolUsage = row.PoolStats.reduce((acc, pool) => {
totalThreadsCount += Number(pool.Threads);
Expand All @@ -259,9 +255,10 @@ export function getCpuColumn<
<CellWithPopover
placement={['top', 'bottom']}
fullWidth
disabled={!row.PoolStats}
content={
<DefinitionList responsive>
{row.PoolStats.map((pool) =>
{row.PoolStats?.map((pool) =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

we check row.PoolStats in upper code - looks like ? is redundant

Copy link
Collaborator

Choose a reason for hiding this comment

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

mislooked - my bad

isNumeric(pool.Usage) ? (
<DefinitionList.Item key={pool.Name} name={pool.Name}>
{formatPool('Usage', pool.Usage).value}
Expand Down
Loading