mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
fix: swap usage compute error
This commit is contained in:
parent
04bf6d78d4
commit
5186f47b75
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ func getMemoryStat() (MemStat, error) {
|
||||||
SwapTotal: humanize.Bytes(memoryStat.SwapTotal),
|
SwapTotal: humanize.Bytes(memoryStat.SwapTotal),
|
||||||
SwapCached: humanize.Bytes(memoryStat.SwapCached),
|
SwapCached: humanize.Bytes(memoryStat.SwapCached),
|
||||||
SwapPercent: cast.ToFloat64(fmt.Sprintf("%.2f",
|
SwapPercent: cast.ToFloat64(fmt.Sprintf("%.2f",
|
||||||
float64(memoryStat.SwapFree)/math.Max(float64(memoryStat.SwapTotal), 1))),
|
100*float64(memoryStat.SwapTotal-memoryStat.SwapFree)/math.Max(float64(memoryStat.SwapTotal), 1))),
|
||||||
Pressure: cast.ToFloat64(fmt.Sprintf("%.2f", memoryStat.UsedPercent)),
|
Pressure: cast.ToFloat64(fmt.Sprintf("%.2f", memoryStat.UsedPercent)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue