]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/metrics: add /gc/scan/stack:bytes
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Tue, 23 May 2023 10:30:43 +0000 (12:30 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 23 May 2023 19:15:10 +0000 (19:15 +0000)
For #56857

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

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

index 4931a0ef8b8ba0a624345582b33d542d530137d7..ffbb4e4d0f4c030d8711a5c6a872d17e2c2b1332 100644 (file)
@@ -300,6 +300,12 @@ func initMetrics() {
                                hist.counts[len(hist.counts)-1] = memstats.gcPauseDist.overflow.Load()
                        },
                },
+               "/gc/scan/stack:bytes": {
+                       compute: func(in *statAggregate, out *metricValue) {
+                               out.kind = metricKindUint64
+                               out.scalar = uint64(gcController.lastStackScan.Load())
+                       },
+               },
                "/gc/stack/starting-size:bytes": {
                        compute: func(in *statAggregate, out *metricValue) {
                                out.kind = metricKindUint64
index e3eb87b353b02c8dad73f2f07a0bdceeae40c258..8355fc5da04272ca5a54b204a72ab34b2320f676 100644 (file)
@@ -294,6 +294,11 @@ var allDesc = []Description{
                Kind:        KindFloat64Histogram,
                Cumulative:  true,
        },
+       {
+               Name:        "/gc/scan/stack:bytes",
+               Description: "The number of bytes of stack that were scanned last GC cycle.",
+               Kind:        KindUint64,
+       },
        {
                Name:        "/gc/stack/starting-size:bytes",
                Description: "The stack size of new goroutines.",
index f95177edc85436094415209fec796175140be61c..7f21278450776e7b7a6728d1d9ee07e997fe6884 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/stack:bytes
+               The number of bytes of stack that were scanned last GC cycle.
+
        /gc/stack/starting-size:bytes
                The stack size of new goroutines.