aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2020-12-04 16:04:53 +0000
committerMichael Knyszek <mknyszek@google.com>2020-12-10 21:08:10 +0000
commitd0f40d29223a2aef58475f81a559b2d27396134a (patch)
treea3eeaa313ab5d8addb966b9d6f5af011cb5e5aa5
parent6d2b3351f6312ebc924d0014013088c69b9c1bc2 (diff)
downloadgo-d0f40d29223a2aef58475f81a559b2d27396134a.tar.gz
go-d0f40d29223a2aef58475f81a559b2d27396134a.zip
runtime/metrics: add ordering line to supported metrics docs
This change adds an additional line explaining the ordering of the supported metrics list. It's also necessary to ensure "Supported metrics" is displayed by godoc as a proper header. This modification does mean the description test, that ensures descriptions line up with documentation, needs to change slightly so it it doesn't read this new line as documentation. Make this new line the line the test uses to decide when to begin. Change-Id: I654c1c20e97a80ea79c8eb864445153ce91950bf Reviewed-on: https://go-review.googlesource.com/c/go/+/275852 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>
-rw-r--r--src/runtime/metrics/description_test.go2
-rw-r--r--src/runtime/metrics/doc.go2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/metrics/description_test.go b/src/runtime/metrics/description_test.go
index 448639ee77..fd1fd46efc 100644
--- a/src/runtime/metrics/description_test.go
+++ b/src/runtime/metrics/description_test.go
@@ -43,7 +43,7 @@ func extractMetricDocs(t *testing.T) map[string]string {
line := strings.TrimSpace(s.Text())
switch state {
case stateSearch:
- if line == "Supported metrics" {
+ if line == "Below is the full list of supported metrics, ordered lexicographically." {
state = stateNextMetric
}
case stateNextMetric:
diff --git a/src/runtime/metrics/doc.go b/src/runtime/metrics/doc.go
index 42b5bc3724..05a887e4f4 100644
--- a/src/runtime/metrics/doc.go
+++ b/src/runtime/metrics/doc.go
@@ -44,6 +44,8 @@ the documentation of the Name field of the Description struct.
Supported metrics
+Below is the full list of supported metrics, ordered lexicographically.
+
/gc/cycles/automatic:gc-cycles
Count of completed GC cycles generated by the Go runtime.