1
0
mirror of https://github.com/golang/go synced 2024-11-16 16:14:40 -07:00

runtime/metrics: add /gc/scan/heap:bytes

For #56857

Change-Id: If3b962f575c33b2cc29f89e33c7aafb476d98ce9
Reviewed-on: https://go-review.googlesource.com/c/go/+/497575
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Felix Geisendörfer 2023-05-23 12:35:48 +02:00 committed by Gopher Robot
parent a63afe4720
commit 131267f147
3 changed files with 14 additions and 0 deletions

View File

@ -195,6 +195,12 @@ func initMetrics() {
out.scalar = gcController.globalsScan.Load()
},
},
"/gc/scan/heap:bytes": {
compute: func(in *statAggregate, out *metricValue) {
out.kind = metricKindUint64
out.scalar = gcController.heapScan.Load()
},
},
"/gc/heap/allocs-by-size:bytes": {
deps: makeStatDepSet(heapStatsDep),
compute: func(in *statAggregate, out *metricValue) {

View File

@ -299,6 +299,11 @@ var allDesc = []Description{
Description: "The total amount of global variable space that is scannable.",
Kind: KindUint64,
},
{
Name: "/gc/scan/heap:bytes",
Description: "The total amount of heap space that is scannable.",
Kind: KindUint64,
},
{
Name: "/gc/scan/stack:bytes",
Description: "The number of bytes of stack that were scanned last GC cycle.",

View File

@ -219,6 +219,9 @@ Below is the full list of supported metrics, ordered lexicographically.
/gc/scan/globals:bytes
The total amount of global variable space that is scannable.
/gc/scan/heap:bytes
The total amount of heap space that is scannable.
/gc/scan/stack:bytes
The number of bytes of stack that were scanned last GC cycle.