-
Notifications
You must be signed in to change notification settings - Fork 0
fix: render missing dashboard metrics #218
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
Conversation
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.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| const parts = String(value).split(/[\s,]+/).filter(Boolean); | ||
| if (parts.length < 3) | ||
| return null; |
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.
[P1] Parse load averages that use commas as decimal separators
The new parseLoadAverage splits the input on every comma and whitespace. Audit files serialise the three loads as a comma‑only string such as "0,13,0,23,0,23", so this logic turns 0,13 into two numbers (0 and 13) and the 5‑minute average becomes 13, which later clamps to 100 % and shows a constant critical load. Consider normalising decimal commas before splitting so 0,13,0,23,0,23 becomes three 0.13 values.
Useful? React with 👍 / 👎.
| function parseSizeToBytes(str) { | ||
| if (!str) | ||
| return null; | ||
| const m = String(str).trim().match(/^([0-9]+(?:[.,][0-9]+)?)\s*(B|KB|MB|GB|TB|KiB|MiB|GiB|TiB)?$/i); |
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.
[P1] Support memory sizes without trailing “B” suffix
The parseSizeToBytes regex only matches units like GiB or MB. The bundled audit JSON uses values such as "15Gi" and "108Mi", which fail the regex and return null, so the RAM and swap cards show N/A and 0 % even though the data is present. Widen the pattern or map to handle Ki, Mi, Gi, etc. so memory usage is calculated correctly.
Useful? React with 👍 / 👎.
| if (usage != null) { | ||
| requestAnimationFrame(() => { | ||
| const pct = Math.max(0, Math.min(100, usage)); | ||
| fillU.style.width = pct + '%'; |
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.
[P1] Define adjustBarValue before using it in metric bars
Several new rendering functions call adjustBarValue(...) inside requestAnimationFrame, but this helper is not defined anywhere in viewer.js. At runtime each callback throws ReferenceError: adjustBarValue is not defined, leaving the bar labels unstyled and littering the console. The function exists in audits/scripts/modules/ui.js, so it needs to be imported or implemented here.
Useful? React with 👍 / 👎.
Summary
Testing
./tests/run.sh(fails: Commande requise manquante : mpstat)https://chatgpt.com/codex/tasks/task_e_68b061475154832da03fdbc7678e7951