]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime/metrics: add /gc/scan/heap:bytes
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Tue, 23 May 2023 10:35:48 +0000 (12:35 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 23 May 2023 19:17:04 +0000 (19:17 +0000)
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>
src/runtime/metrics.go
src/runtime/metrics/description.go
src/runtime/metrics/doc.go

index da189565c58d6a207b4a4a5a237320396da014b4..356d21ae7d4d0a38a5669cf1de05d603e30670ce 100644 (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) {
index 8275148fdd4a56d3a8ef96df76fe669eba2aef6d..ac6f43707593abea89ffa1d0b2db1151cc1f9d9b 100644 (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.",
index 0392e76677ab93892e2b16f9237d1fe52d540aa4..15fba2b5d443e472dba783849ce28faa9066be2b 100644 (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.