From d0f40d29223a2aef58475f81a559b2d27396134a Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Fri, 4 Dec 2020 16:04:53 +0000 Subject: [PATCH] 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 TryBot-Result: Go Bot Trust: Michael Knyszek Reviewed-by: Michael Pratt --- src/runtime/metrics/description_test.go | 2 +- src/runtime/metrics/doc.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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. -- 2.50.0