aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-07-23 18:41:56 +0000
committerGopher Robot <gobot@golang.org>2025-08-15 11:31:04 -0700
commitab8121a407280bf39bdd401699476feb39ccd0f7 (patch)
treef7ae1dbfe10d24343219f76104d9631197834bab /src/runtime/proc.go
parent13df972f6885ebdeba1ea38f0acd99ea0f2bfb49 (diff)
downloadgo-ab8121a407280bf39bdd401699476feb39ccd0f7.tar.xz
runtime/metrics: add metric for total goroutines created
For #15490. Change-Id: Ic587dda1f42d613ea131a6b53ce6ba6e6cadf4c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/690398 Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 15f10f087e..329d1b2624 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -5262,6 +5262,7 @@ func newproc1(fn *funcval, callergp *g, callerpc uintptr, parked bool, waitreaso
racereleasemergeg(newg, unsafe.Pointer(&labelSync))
}
}
+ pp.goroutinesCreated++
releasem(mp)
return newg
@@ -5841,6 +5842,8 @@ func (pp *p) destroy() {
pp.gcAssistTime = 0
gcCleanups.queued += pp.cleanupsQueued
pp.cleanupsQueued = 0
+ sched.goroutinesCreated.Add(int64(pp.goroutinesCreated))
+ pp.goroutinesCreated = 0
pp.xRegs.free()
pp.status = _Pdead
}