Skip to content

Commit 8b51eb5

Browse files
felixgegopherbot
authored andcommitted
runtime/metrics: add /gc/scan/stack:bytes
For #56857 Change-Id: I58187d7c4112b35951014ab14f2969bed7f4c8e1 Reviewed-on: https://go-review.googlesource.com/c/go/+/497319 Run-TryBot: Felix Geisendörfer <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> Reviewed-by: David Chase <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 1eae5c1 commit 8b51eb5

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/runtime/metrics.go

+6
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@ func initMetrics() {
300300
hist.counts[len(hist.counts)-1] = memstats.gcPauseDist.overflow.Load()
301301
},
302302
},
303+
"/gc/scan/stack:bytes": {
304+
compute: func(in *statAggregate, out *metricValue) {
305+
out.kind = metricKindUint64
306+
out.scalar = uint64(gcController.lastStackScan.Load())
307+
},
308+
},
303309
"/gc/stack/starting-size:bytes": {
304310
compute: func(in *statAggregate, out *metricValue) {
305311
out.kind = metricKindUint64

src/runtime/metrics/description.go

+5
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ var allDesc = []Description{
294294
Kind: KindFloat64Histogram,
295295
Cumulative: true,
296296
},
297+
{
298+
Name: "/gc/scan/stack:bytes",
299+
Description: "The number of bytes of stack that were scanned last GC cycle.",
300+
Kind: KindUint64,
301+
},
297302
{
298303
Name: "/gc/stack/starting-size:bytes",
299304
Description: "The stack size of new goroutines.",

src/runtime/metrics/doc.go

+3
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ Below is the full list of supported metrics, ordered lexicographically.
216216
Distribution of individual GC-related stop-the-world pause
217217
latencies. Bucket counts increase monotonically.
218218
219+
/gc/scan/stack:bytes
220+
The number of bytes of stack that were scanned last GC cycle.
221+
219222
/gc/stack/starting-size:bytes
220223
The stack size of new goroutines.
221224

0 commit comments

Comments
 (0)