diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2021-04-20 19:30:21 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2021-04-29 21:54:05 +0000 |
commit | 897baae953ca812005703d367234b3b867f2a4b0 (patch) | |
tree | 7ce11f007a16186fffadaa164b8051fb1a5efde0 /src/cmd/compile/internal/reflectdata/reflect.go | |
parent | fd095936673dcb53b96b825d95c1e83adde3ce15 (diff) | |
download | go-897baae953ca812005703d367234b3b867f2a4b0.tar.gz go-897baae953ca812005703d367234b3b867f2a4b0.zip |
runtime/metrics: add additional allocation metrics
This change adds four additional metrics to the runtime/metrics package
to fill in a few gaps with runtime.MemStats that were overlooked. The
biggest one is TotalAlloc, which is impossible to find with the
runtime/metrics package, but also add a few others for convenience and
clarity. For instance, the total number of objects allocated and freed
are technically available via allocs-by-size and frees-by-size, but it's
onerous to get them (one needs to sum the sample counts in the
histograms).
The four additional metrics are:
- /gc/heap/allocs:bytes -- total bytes allocated (TotalAlloc)
- /gc/heap/allocs:objects -- total objects allocated (Mallocs - [tiny])
- /gc/heap/frees:bytes -- total bytes frees (TotalAlloc-HeapAlloc)
- /gc/heap/frees:objects -- total objects freed (Frees - [tiny])
This change also updates the descriptions of allocs-by-size and
frees-by-size to be more precise.
Change-Id: Iec8c1797a584491e3484b198f2e7f325b68954a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/312431
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata/reflect.go')
0 files changed, 0 insertions, 0 deletions