Skip to content

Commit

Permalink
metric: add GC CPU Fraction
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <hexian000@outlook.com>
  • Loading branch information
hexian000 committed Jun 7, 2024
1 parent 52f1c32 commit 68d7e5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions v2/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func printMemStats(w io.Writer, lastGC bool) {
fprintf(w, "%-20s: %s (+%s)\n", "Total Allocated",
formats.IECBytes(float64(memstats.Sys-memstats.HeapReleased)),
formats.IECBytes(float64(memstats.HeapReleased)))
fprintf(w, "%-20s: %.07f%%\n", "GC CPU Fraction",
memstats.GCCPUFraction*100.0/float64(runtime.GOMAXPROCS(0)))
if !lastGC {
return
}
Expand Down

0 comments on commit 68d7e5c

Please sign in to comment.