add more cpu metrics (#1356)

- adds monitoring for cpu state time and per-core usage

Co-authored-by: Sven van Ginkel <svenvanginkel@icloud.com>
This commit is contained in:
henrygd
2025-11-01 12:57:48 -04:00
parent 3dbc48727e
commit 6a562ce03b
14 changed files with 407 additions and 46 deletions

View File

@@ -56,7 +56,7 @@ func GetBatteryStats() (batteryPercent uint8, batteryState uint8, err error) {
// if there were some errors, like missing data, skip it
continue
}
if bat.Full == 0 {
if bat == nil || bat.Full == 0 {
// skip batteries with no capacity. Charge is unlikely to ever be zero, but
// we can't guarantee that, so don't skip based on charge.
continue