Skip to content

Commit c9d6f45

Browse files
runtime/metrics: fix a couple of documentation typpos
Fixes #44150 Change-Id: Ibe5bfba01491dd8c2f0696fab40a1673230d76e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/290349 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent cea4e21 commit c9d6f45

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/runtime/metrics/doc.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ Interface
1616
Metrics are designated by a string key, rather than, for example, a field name in
1717
a struct. The full list of supported metrics is always available in the slice of
1818
Descriptions returned by All. Each Description also includes useful information
19-
about the metric, such as how to display it (e.g. gauge vs. counter) and how difficult
20-
or disruptive it is to obtain it (e.g. do you need to stop the world?).
19+
about the metric, such as how to display it (for example, gauge vs. counter)
20+
and how difficult or disruptive it is to obtain it (for example, do you need to
21+
stop the world?).
2122
2223
Thus, users of this API are encouraged to sample supported metrics defined by the
2324
slice returned by All to remain compatible across Go versions. Of course, situations
2425
arise where reading specific metrics is critical. For these cases, users are
25-
encouranged to use build tags, and although metrics may be deprecated and removed,
26+
encouraged to use build tags, and although metrics may be deprecated and removed,
2627
users should consider this to be an exceptional and rare event, coinciding with a
2728
very large change in a particular Go implementation.
2829

src/runtime/metrics/sample.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ func runtime_readMetrics(unsafe.Pointer, int, int)
3232
//
3333
// Note that re-use has some caveats. Notably, Values should not be read or
3434
// manipulated while a Read with that value is outstanding; that is a data race.
35-
// This property includes pointer-typed Values (e.g. Float64Histogram) whose
36-
// underlying storage will be reused by Read when possible. To safely use such
37-
// values in a concurrent setting, all data must be deep-copied.
35+
// This property includes pointer-typed Values (for example, Float64Histogram)
36+
// whose underlying storage will be reused by Read when possible. To safely use
37+
// such values in a concurrent setting, all data must be deep-copied.
3838
//
3939
// It is safe to execute multiple Read calls concurrently, but their arguments
4040
// must share no underlying memory. When in doubt, create a new []Sample from

src/runtime/metrics/value.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Value struct {
3333
pointer unsafe.Pointer // contains non-scalar values.
3434
}
3535

36-
// Kind returns the a tag representing the kind of value this is.
36+
// Kind returns the tag representing the kind of value this is.
3737
func (v Value) Kind() ValueKind {
3838
return v.kind
3939
}

0 commit comments

Comments
 (0)