Improve Memory Reporting

This commit is contained in:
Samuel Lorch 2024-05-04 01:30:10 +02:00
parent 0be5af70c3
commit e51abbcbf7

View file

@ -23,8 +23,8 @@ func status(ctx context.Context, req rpc.Request) (any, error) {
}
mStats, _ := memory.Get()
if mStats != nil {
s.MemoryUsage = mStats.Used
s.MemoryTotal = mStats.Total
s.MemoryUsage = uint64(float64(mStats.Used) / float64(mStats.Total) * 100)
s.MemoryTotal = mStats.Total / 1000000000
}
return s, nil