fix: show idle GPU utilization in systems table (#2312)

This commit is contained in:
henrygd
2026-09-07 13:13:05 -04:00
parent 08d813620c
commit 997adc19bb
3 changed files with 54 additions and 2 deletions

View File

@@ -272,7 +272,15 @@ func (sys *System) createRecords(data *system.CombinedData) (*core.Record, error
// update system record (do this last because it triggers alerts and we need above records to be inserted first)
systemRecord.Set("status", up)
systemRecord.Set("info", data.Info)
// Distinguish an idle GPU from a system without GPU data (#2312)
info := struct {
system.Info
GpuPct *float64 `json:"g,omitempty"`
}{Info: data.Info}
if len(data.Stats.GPUData) > 0 {
info.GpuPct = &data.Info.GpuPct
}
systemRecord.Set("info", info)
if err := txApp.SaveNoValidate(systemRecord); err != nil {
return err
}