aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/metrics
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2020-08-06 16:47:58 +0000
committerMichael Knyszek <mknyszek@google.com>2020-10-26 18:29:24 +0000
commita8b28ebc87854fb6f2ba99f415f046dc2ff63604 (patch)
treea1d157399536326322763d8e9161ce656f4064e8 /src/runtime/metrics
parent07c3f65d53df7bb9f84bdbd2ab64c0ae12337e3e (diff)
downloadgo-a8b28ebc87854fb6f2ba99f415f046dc2ff63604.tar.gz
go-a8b28ebc87854fb6f2ba99f415f046dc2ff63604.zip
runtime,runtime/metrics: add heap goal and GC cycle metrics
This change adds three new metrics: the heap goal, GC cycle count, and forced GC count. These metrics are identical to their MemStats counterparts. For #37112. Change-Id: I5a5e8dd550c0d646e5dcdbdf38274895e27cdd88 Reviewed-on: https://go-review.googlesource.com/c/go/+/247044 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')
-rw-r--r--src/runtime/metrics/description.go23
-rw-r--r--src/runtime/metrics/doc.go12
2 files changed, 35 insertions, 0 deletions
diff --git a/src/runtime/metrics/description.go b/src/runtime/metrics/description.go
index 47013e1451..66d229c270 100644
--- a/src/runtime/metrics/description.go
+++ b/src/runtime/metrics/description.go
@@ -51,6 +51,29 @@ type Description struct {
// descriptions of each metric in doc.go.
var allDesc = []Description{
{
+ Name: "/gc/cycles/automatic:gc-cycles",
+ Description: "Count of completed GC cycles generated by the Go runtime.",
+ Kind: KindUint64,
+ Cumulative: true,
+ },
+ {
+ Name: "/gc/cycles/forced:gc-cycles",
+ Description: "Count of completed forced GC cycles.",
+ Kind: KindUint64,
+ Cumulative: true,
+ },
+ {
+ Name: "/gc/cycles/total:gc-cycles",
+ Description: "Count of all completed GC cycles.",
+ Kind: KindUint64,
+ Cumulative: true,
+ },
+ {
+ Name: "/gc/heap/goal:bytes",
+ Description: "Heap size target for the end of the GC cycle.",
+ Kind: KindUint64,
+ },
+ {
Name: "/gc/heap/objects:objects",
Description: "Number of objects, live or unswept, occupying heap memory.",
Kind: KindUint64,
diff --git a/src/runtime/metrics/doc.go b/src/runtime/metrics/doc.go
index 4ac44bb19c..9b44e73ee6 100644
--- a/src/runtime/metrics/doc.go
+++ b/src/runtime/metrics/doc.go
@@ -44,6 +44,18 @@ the documentation of the Name field of the Description struct.
Supported metrics
+ /gc/cycles/automatic:gc-cycles
+ Count of completed GC cycles generated by the Go runtime.
+
+ /gc/cycles/forced:gc-cycles
+ Count of completed forced GC cycles.
+
+ /gc/cycles/total:gc-cycles
+ Count of all completed GC cycles.
+
+ /gc/heap/goal:bytes
+ Heap size target for the end of the GC cycle.
+
/gc/heap/objects:objects
Number of objects, live or unswept, occupying heap memory.