Skip to content

Comments

fix: visualize CPU and Memory usage with LineProgress in pod list#1556

Merged
omarluq merged 2 commits intofreelensapp:mainfrom
HanCheo:pod-detail-list
Jan 27, 2026
Merged

fix: visualize CPU and Memory usage with LineProgress in pod list#1556
omarluq merged 2 commits intofreelensapp:mainfrom
HanCheo:pod-detail-list

Conversation

@HanCheo
Copy link
Contributor

@HanCheo HanCheo commented Jan 27, 2026

close: #851

  1. Fixed an issue where the line progress for CPU and memory was not visible in PodDetailsList.
  2. When operating with virtualList, the issue where node names were visible because the hideNode and LinkedPod arguments were not passed to getTableRow has been fixed.
image

@omarluq omarluq added this to the v1.8.1 milestone Jan 27, 2026
Copy link
Collaborator

@omarluq omarluq left a comment

Choose a reason for hiding this comment

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

LGTM thank you for fixing this ❤️ the comment is to address an edge case that your fix exposes but doesn't block your pr

Comment on lines +112 to +113
getTableRow(uid: string) {
const { pods, owner, podStore, showDetails } = this.props;
Copy link
Collaborator

@omarluq omarluq Jan 27, 2026

Choose a reason for hiding this comment

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

Image

When testing I found an edge case unrelated to this fix stemming from getPodKubeMetrics:
pods in terminal states (Succeeded or Failed), which never have metrics reported, as well as
pods for which metrics have not yet been collected, result in { cpu: NaN, memory: NaN }.
These NaN values then propagate into the UI.

We have a few options to fix this:

  1. UI-level guard (in getTableRow), i.e.
const { cpu, memory } = podStore.getPodKubeMetrics(pod) ?? {};

const safeCpu = Number.isFinite(cpu) ? cpu : 0;
const safeMemory = Number.isFinite(memory) ? memory : 0;    
  1. Store-level fix: never return NaN from getPodKubeMetrics. Treat “no metrics available” as 0 usage.

  2. Store-level fix: return null to represent “unknown”. This is more semantically correct, but requires UI changes to display and handle sorting

@omarluq omarluq merged commit 3134218 into freelensapp:main Jan 27, 2026
11 checks passed
@omarluq omarluq added the bug Something isn't working label Jan 27, 2026
@robertobandini
Copy link
Member

Thanks @HanCheo and @omarluq!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No CPU or Memory metrics for pods list in the nodes detail view

3 participants