]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/metrics/sample.go
runtime: add available godoc link
[gostls13.git] / src / runtime / metrics / sample.go
index 35534dd70da50f6cf05cc21845f24e781e8dd1ad..9efc5c5f06a934f69b550430a88af47514572220 100644 (file)
@@ -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.
@@ -24,7 +24,7 @@ type Sample struct {
 // Implemented in the runtime.
 func runtime_readMetrics(unsafe.Pointer, int, int)
 
-// Read populates each Value field in the given slice of metric samples.
+// 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 for
@@ -32,15 +32,15 @@ func runtime_readMetrics(unsafe.Pointer, int, int)
 //
 // Note that re-use has some caveats. Notably, Values should not be read or
 // manipulated while a Read with that value is outstanding; that is a data race.
-// This property includes pointer-typed Values (e.g. Float64Histogram) whose
-// underlying storage will be reused by Read when possible. To safely use such
-// values in a concurrent setting, all data must be deep-copied.
+// This property includes pointer-typed Values (for example, [Float64Histogram])
+// whose underlying storage will be reused by Read when possible. To safely use
+// such values in a concurrent setting, all data must be deep-copied.
 //
 // It is safe to execute multiple Read calls concurrently, but their arguments
 // must share no underlying memory. When in doubt, create a new []Sample from
 // scratch, which is always safe, though may be inefficient.
 //
-// Sample values with names not appearing in All will have their Value populated
+// 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))