aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/metrics.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2020-08-06 21:59:13 +0000
committerMichael Knyszek <mknyszek@google.com>2020-10-26 21:47:54 +0000
commitd39a89fd5843f535d634620d27110b320431f584 (patch)
treed44fd02351cc88c0d28e48465a3e5ac3bd056ff9 /src/runtime/metrics.go
parent36c5edd8d9e6c13af26733e5c820eae0598203fe (diff)
downloadgo-d39a89fd5843f535d634620d27110b320431f584.tar.gz
go-d39a89fd5843f535d634620d27110b320431f584.zip
runtime,runtime/metrics: add metric for distribution of GC pauses
For #37112. Change-Id: Ibb0425c9c582ae3da3b2662d5bbe830d7df9079c Reviewed-on: https://go-review.googlesource.com/c/go/+/247047 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>
Diffstat (limited to 'src/runtime/metrics.go')
-rw-r--r--src/runtime/metrics.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/metrics.go b/src/runtime/metrics.go
index 2be38ccaaa..0e391472b2 100644
--- a/src/runtime/metrics.go
+++ b/src/runtime/metrics.go
@@ -102,6 +102,15 @@ func initMetrics() {
out.scalar = in.heapStats.numObjects
},
},
+ "/gc/pauses:seconds": {
+ compute: func(_ *statAggregate, out *metricValue) {
+ hist := out.float64HistOrInit(timeHistBuckets)
+ hist.counts[len(hist.counts)-1] = atomic.Load64(&memstats.gcPauseDist.overflow)
+ for i := range hist.buckets {
+ hist.counts[i] = atomic.Load64(&memstats.gcPauseDist.counts[i])
+ }
+ },
+ },
"/memory/classes/heap/free:bytes": {
deps: makeStatDepSet(heapStatsDep),
compute: func(in *statAggregate, out *metricValue) {