]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime/metrics: add /gc/scan/globals: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:16:04 +0000 (19:16 +0000)
For #56857

Change-Id: I748fd2a33ee76d9a83ea42f2ebf6d9edda243301
Reviewed-on: https://go-review.googlesource.com/c/go/+/497320
Run-TryBot: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/runtime/metrics.go
src/runtime/metrics/description.go
src/runtime/metrics/doc.go

index ffbb4e4d0f4c030d8711a5c6a872d17e2c2b1332..da189565c58d6a207b4a4a5a237320396da014b4 100644 (file)
@@ -189,6 +189,12 @@ func initMetrics() {
                                out.scalar = in.sysStats.gcCyclesDone
                        },
                },
+               "/gc/scan/globals:bytes": {
+                       compute: func(in *statAggregate, out *metricValue) {
+                               out.kind = metricKindUint64
+                               out.scalar = gcController.globalsScan.Load()
+                       },
+               },
                "/gc/heap/allocs-by-size:bytes": {
                        deps: makeStatDepSet(heapStatsDep),
                        compute: func(in *statAggregate, out *metricValue) {
index 8355fc5da04272ca5a54b204a72ab34b2320f676..8275148fdd4a56d3a8ef96df76fe669eba2aef6d 100644 (file)
@@ -294,6 +294,11 @@ var allDesc = []Description{
                Kind:        KindFloat64Histogram,
                Cumulative:  true,
        },
+       {
+               Name:        "/gc/scan/globals:bytes",
+               Description: "The total amount of global variable 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 7f21278450776e7b7a6728d1d9ee07e997fe6884..0392e76677ab93892e2b16f9237d1fe52d540aa4 100644 (file)
@@ -216,6 +216,9 @@ Below is the full list of supported metrics, ordered lexicographically.
                Distribution of individual GC-related stop-the-world pause
                latencies. Bucket counts increase monotonically.
 
+       /gc/scan/globals:bytes
+               The total amount of global variable space that is scannable.
+
        /gc/scan/stack:bytes
                The number of bytes of stack that were scanned last GC cycle.