Skip to content

Commit

Permalink
metric: count heap objects
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <[email protected]>
  • Loading branch information
hexian000 committed Dec 17, 2024
1 parent cd08433 commit a30bb03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions v3/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ func printMemStats(w io.Writer, lastGC bool) {
fprintf(w, "%-20s: %s < %s\n", "Heap Next GC",
formats.IECBytes(float64(memstats.HeapAlloc)),
formats.IECBytes(float64(memstats.NextGC)))
fprintf(w, "%-20s: %s ≤ %s\n", "Heap In-use",
fprintf(w, "%-20s: %s ≤ %s (%s objects)\n", "Heap In-use",
formats.IECBytes(float64(memstats.HeapInuse)),
formats.IECBytes(float64(memstats.HeapSys-memstats.HeapReleased)))
formats.IECBytes(float64(memstats.HeapSys-memstats.HeapReleased)),
formats.SIPrefix(float64(memstats.HeapObjects)))
fprintf(w, "%-20s: %s ≤ %s\n", "Stack In-use",
formats.IECBytes(float64(memstats.StackInuse)),
formats.IECBytes(float64(memstats.StackSys)))
Expand Down

0 comments on commit a30bb03

Please sign in to comment.