mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
The page listed only PAST high-CPU periods (the event rows written by the CPU monitor), so it could not answer "what is the CPU doing right now?" at all - the one question an admin opens that page to ask. A live line now sits between the page title and the search box: the current system CPU percentage, the core count, the 1/5/15 minute load average and the coarse "what WeKan is doing" label, refreshed every 5 seconds and outlined in red while the monitor considers the CPU sustainedly high. The figure comes from getCurrentCpu() in the CPU monitor, which reads the same sample the monitor writes its event rows from, so the header and the rows below it can never disagree. It reads module state only - no sampling of its own - so polling it is cheap. When the background monitor is disabled (WEKAN_CPU_MONITOR=false) it would otherwise always read 0%, so in that case the percentage is measured between calls using a SEPARATE baseline, which cannot disturb the monitor's own delta, and `monitored: false` is reported alongside. Thanks to xet7 !