add swap usage chart

This commit is contained in:
Henry Dollman
2024-08-06 16:46:25 -04:00
parent dcdee1d943
commit cdd10a3011
6 changed files with 99 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ func getSystemStats() (*SystemInfo, *SystemStats) {
systemStats.MemUsed = bytesToGigabytes(v.Used)
systemStats.MemBuffCache = bytesToGigabytes(v.Total - v.Free - v.Used)
systemStats.MemPct = twoDecimals(v.UsedPercent)
systemStats.Swap = bytesToGigabytes(v.SwapTotal)
systemStats.SwapUsed = bytesToGigabytes(v.SwapTotal - v.SwapFree)
}
// disk usage