1
0
mirror of https://github.com/golang/go synced 2024-09-23 17:20:13 -06:00

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>
This commit is contained in:
Michael Anthony Knyszek 2020-12-04 16:04:53 +00:00 committed by Michael Knyszek
parent 6d2b3351f6
commit d0f40d2922
2 changed files with 3 additions and 1 deletions

View File

@ -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:

View File

@ -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.