aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBranden J Brown <zephyrtronium@gmail.com>2021-02-15 23:12:15 -0500
committerMichael Knyszek <mknyszek@google.com>2021-02-16 16:26:30 +0000
commit1004a7cb31ae31d2ca0b54b507b996c12403d54c (patch)
treecc21c90c24037aed8117189f7862ce0e171772aa
parent6530f2617f3100d8f1036afc5cb9b30b36628aaa (diff)
downloadgo-1004a7cb31ae31d2ca0b54b507b996c12403d54c.tar.gz
go-1004a7cb31ae31d2ca0b54b507b996c12403d54c.zip
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 <mknyszek@google.com> Trust: Michael Knyszek <mknyszek@google.com> Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
-rw-r--r--src/runtime/metrics/doc.go4
-rw-r--r--src/runtime/metrics/sample.go2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/runtime/metrics/doc.go b/src/runtime/metrics/doc.go
index 5da050f973b..7f790afc12e 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 b3933e266ed..4cf8cdf7994 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.