From: Michael Anthony Knyszek Date: Fri, 4 Dec 2020 16:04:53 +0000 (+0000) Subject: runtime/metrics: add ordering line to supported metrics docs X-Git-Tag: go1.16beta1~49 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d0f40d2922;p=gostls13.git 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 --- 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.