Stats: add CPU load trend series to history and web panel
Wire the 1-minute CPU load average into the stats history pipeline: - Rename HistorySample::reserved to load_avg1_pct (uint8_t, 0-100); struct size unchanged. - Populate load_avg1_pct in updateStatsHistory on ESP32 from _cpu_tracker.getLoadAvg1() * 100. - Register "cpu_load" series in buildPointValue / seriesTitle / seriesUnit so buildSeriesJson serves it via /api/stats?series=cpu_load. - Persist load_avg1_pct as a 29th CSV column in flushSummaryLog. parseSummaryLine accepts both 28-column (old, load_avg1_pct=0) and 29-column (new) formats for backward compatibility. - Add "cpu_load" to the web panel trend card order with orange sparkline color (#e07b39), "N %" hover formatting, and a Y-axis floored at 0 with a 10% minimum ceiling.
Этот коммит содержится в:
@@ -1941,6 +1941,7 @@ void MyMesh::updateStatsHistory(unsigned long now_ms) {
|
||||
sample.heap_min = ESP.getMinFreeHeap();
|
||||
sample.psram_free = ESP.getFreePsram();
|
||||
sample.psram_min = ESP.getMinFreePsram();
|
||||
sample.load_avg1_pct = (uint8_t)(_cpu_tracker.getLoadAvg1() * 100.0f + 0.5f);
|
||||
#endif
|
||||
if (board.isExternalPowered()) sample.flags |= HISTORY_FLAG_EXTERNAL_POWER;
|
||||
if (board.isCharging()) sample.flags |= HISTORY_FLAG_CHARGING;
|
||||
|
||||
Ссылка в новой задаче
Block a user