mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime,runtime/metrics: export goroutine count as a metric
For #37112. Change-Id: I994dfe848605b95ef6aec24f53869e929247e987 Reviewed-on: https://go-review.googlesource.com/c/go/+/247049 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
d39a89fd58
commit
80c6b92ecb
4 changed files with 18 additions and 0 deletions
|
|
@ -214,6 +214,12 @@ func initMetrics() {
|
|||
in.sysStats.gcMiscSys + in.sysStats.otherSys
|
||||
},
|
||||
},
|
||||
"/sched/goroutines:goroutines": {
|
||||
compute: func(_ *statAggregate, out *metricValue) {
|
||||
out.kind = metricKindUint64
|
||||
out.scalar = uint64(gcount())
|
||||
},
|
||||
},
|
||||
}
|
||||
metricsInit = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue