]> Cypherpunks repositories - gostls13.git/commit
runtime/metrics: refactor CPU stats accumulation
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 18 May 2023 16:35:11 +0000 (16:35 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 23 May 2023 19:24:55 +0000 (19:24 +0000)
commit3651d8e516950c46035cdc04ec3db1146f0590d2
tree8840e9f6e3ef91a8435d9295205c7eb759a60aa2
parent6f13d0bfe42115d1d5452bee0bb7648d968beeb4
runtime/metrics: refactor CPU stats accumulation

Currently the CPU stats are only updated once every mark termination,
but for writing robust tests, it's often useful to force this update.
Refactor the CPU stats accumulation out of gcMarkTermination and into
its own function. This is also a step toward real-time CPU stats.

While we're here, fix some incorrect documentation about dedicated GC
CPU time.

For #59749.
For #60276.

Change-Id: I8c1a9aca45fcce6ce7999702ae4e082853a69711
Reviewed-on: https://go-review.googlesource.com/c/go/+/487215
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/runtime/metrics.go
src/runtime/metrics/description.go
src/runtime/metrics/doc.go
src/runtime/mgc.go
src/runtime/mstats.go