]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/metrics: clarify Read's documentation
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 19 Nov 2020 15:07:06 +0000 (15:07 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 19 Nov 2020 20:37:38 +0000 (20:37 +0000)
Change-Id: Idbcbc304f1568399a82af9dcd51e511393ed5ee0
Reviewed-on: https://go-review.googlesource.com/c/go/+/271558
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>
src/runtime/metrics/sample.go

index b4b0979aa6f3412258f300a7a24b07a6098050eb..60189cb334b8c1ab7508c0b325d711860aef9984 100644 (file)
@@ -27,11 +27,11 @@ func runtime_readMetrics(unsafe.Pointer, int, int)
 // Read populates each Value field in the given slice of metric samples.
 //
 // Desired metrics should be present in the slice with the appropriate name.
-// The user of this API is encouraged to re-use the same slice between calls.
+// The user of this API is encouraged to re-use the same slice between calls for
+// efficiency, but is not required to do so.
 //
-// Metric values with names not appearing in the value returned by Descriptions
-// will have the value populated as KindBad to indicate that the name is
-// unknown.
+// Sample values with names not appearing in All will have their Value populated
+// as KindBad to indicate that the name is unknown.
 func Read(m []Sample) {
        runtime_readMetrics(unsafe.Pointer(&m[0]), len(m), cap(m))
 }