From: Branden J Brown Date: Tue, 16 Feb 2021 04:12:15 +0000 (-0500) Subject: runtime/metrics: update documentation to current interface X-Git-Tag: go1.16~1^2 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1004a7cb31;p=gostls13.git runtime/metrics: update documentation to current interface The package documentation referenced sample metadata that was removed in CL 282632. Update this documentation to be less specific about what metadata is available. Additionally, the documentation on the Sample type referred to Descriptions instead of All as the source of metrics names. Fixes #44280. Change-Id: I24fc63a744bf498cb4cd5bda56c1599f6dd75929 Reviewed-on: https://go-review.googlesource.com/c/go/+/292309 Reviewed-by: Michael Knyszek Trust: Michael Knyszek Trust: Dmitri Shuralyov Run-TryBot: Michael Knyszek TryBot-Result: Go Bot --- diff --git a/src/runtime/metrics/doc.go b/src/runtime/metrics/doc.go index 5da050f973..7f790afc12 100644 --- a/src/runtime/metrics/doc.go +++ b/src/runtime/metrics/doc.go @@ -16,9 +16,7 @@ Interface Metrics are designated by a string key, rather than, for example, a field name in a struct. The full list of supported metrics is always available in the slice of Descriptions returned by All. Each Description also includes useful information -about the metric, such as how to display it (for example, gauge vs. counter) -and how difficult or disruptive it is to obtain it (for example, do you need to -stop the world?). +about the metric. Thus, users of this API are encouraged to sample supported metrics defined by the slice returned by All to remain compatible across Go versions. Of course, situations diff --git a/src/runtime/metrics/sample.go b/src/runtime/metrics/sample.go index b3933e266e..4cf8cdf799 100644 --- a/src/runtime/metrics/sample.go +++ b/src/runtime/metrics/sample.go @@ -14,7 +14,7 @@ type Sample struct { // Name is the name of the metric sampled. // // It must correspond to a name in one of the metric descriptions - // returned by Descriptions. + // returned by All. Name string // Value is the value of the metric sample.