Skip to content

Commit

Permalink
increasing precision for virtual memory used percent
Browse files Browse the repository at this point in the history
  • Loading branch information
ray.janoka authored and ray.janoka committed Apr 4, 2024
1 parent e230f52 commit 0eb8e63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mem/mem_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) {
Total: memInfo.ullTotalPhys,
Available: memInfo.ullAvailPhys,
Free: memInfo.ullAvailPhys,
UsedPercent: float64(memInfo.dwMemoryLoad),
UsedPercent: float64(memInfo.ullTotalPhys-memInfo.ullAvailPhys) / float64(memInfo.ullTotalPhys) * 100,
}

ret.Used = ret.Total - ret.Available
Expand Down

0 comments on commit 0eb8e63

Please # to comment.