Repository navigation
fix(webui): colour the process MEM% cell by memory_percent, not cpu_percent - #3699
Conversation
|
Hi @ntdatt812 all the lastest WebUI PR generate conflict on the glances.js file. This file is generate dynamically during release. It should not be committed in PR. Can you rework all previous PR ? You can also put all the PR in one big PR. Nicolas |
…ercent getMemoryPercentAlert passed process.cpu_percent to the memory threshold lookup, so the MEM% column in the process list was decorated from CPU usage. The curses UI colours it correctly, from p['memory_percent'] with header="mem", so the two UIs disagreed about the same process table. With the shipped defaults (mem 50/70/90) a process holding 94% of RAM while idle shows no alert, and a busy loop with a 0.4% footprint paints its MEM% cell red. Both the list and the tree render path go through this one helper. Bundle rebuilt. Undoing just this identifier in the rebuilt public/glances.js makes it byte-identical to the committed one, so nothing else rode along.
4507109 to
8561516
Compare
|
Done, and thanks for saying it plainly. All five open WebUI PRs are rebased onto current
One source file each, nothing generated. I rebuilt each branch from I saw 076469f land while I was doing this. Understood, and I have On merging them into one PR: happy either way. They are five unrelated one-line-class fixes in five different plugins, all of the same shape, each reading the wrong field for a colour, so as separate PRs you can drop any one of them without touching the rest. But if one PR is less work for you, say so and I will fold them into a single branch today. |
|
Perfect @ntdatt812 Merged into develop, i will make some smoke tests on my side before generating the glances.js file. Thanks for your work ! |
The bug
plugin-processlist.vuedecorates the MEM% column using the CPU% value:The cell right next to it renders
process.memory_percent, so in the most-looked-at table in Glances the number and its colour come from different fields. Both render paths — the flat list and the tree view — go through this one helper.The curses UI gets it right:
What a user sees, with the shipped defaults
conf/glances.confshipsmem_careful/warning/critical = 50/70/90. Running the realgetAlertfromservices.jsagainst them:The process you'd open Glances to find — the one eating memory — is exactly the one that stays green, while a CPU-busy process with a negligible footprint is flagged instead.
Bundle
public/glances.jsis rebuilt. A byte-offset diff is useless here becausememory_percentis 3 bytes longer thancpu_percent, so everything after it shifts. Instead, undoing just that identifier in the rebuilt bundle:Byte-identical. So the rebuild carried nothing but this change, and the size delta is exactly +3.
Related
Same class of defect as #3698, which I opened for
plugin-percpu.vue(the iowait cell coloured bysystem). They're independent files, so I kept them as separate PRs — merge order doesn't matter.I checked every other
GlancesHelper.getAlertcall site injs/components/; these two were the only mismatches.plugin-raid.vuealready mirrorsRaidPlugin.raid_alertcorrectly.