diff --git a/src/runtime/metrics.go b/src/runtime/metrics.go index 4931a0ef8b8ba0a624345582b33d542d530137d7..ffbb4e4d0f4c030d8711a5c6a872d17e2c2b1332 100644 --- a/src/runtime/metrics.go +++ b/src/runtime/metrics.go @@ -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 diff --git a/src/runtime/metrics/description.go b/src/runtime/metrics/description.go index e3eb87b353b02c8dad73f2f07a0bdceeae40c258..8355fc5da04272ca5a54b204a72ab34b2320f676 100644 --- a/src/runtime/metrics/description.go +++ b/src/runtime/metrics/description.go @@ -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.", diff --git a/src/runtime/metrics/doc.go b/src/runtime/metrics/doc.go index f95177edc85436094415209fec796175140be61c..7f21278450776e7b7a6728d1d9ee07e997fe6884 100644 --- a/src/runtime/metrics/doc.go +++ b/src/runtime/metrics/doc.go @@ -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.