Skip to content

Commit

Permalink
runtime/metrics: fix a couple of documentation typpos
Browse files Browse the repository at this point in the history
Fixes golang#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]>
  • Loading branch information
ianlancetaylor committed Feb 9, 2021
1 parent cea4e21 commit c9d6f45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/runtime/metrics/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ 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 (e.g. gauge vs. counter) and how difficult
or disruptive it is to obtain it (e.g. do you need to stop the world?).
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?).
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
arise where reading specific metrics is critical. For these cases, users are
encouranged to use build tags, and although metrics may be deprecated and removed,
encouraged to use build tags, and although metrics may be deprecated and removed,
users should consider this to be an exceptional and rare event, coinciding with a
very large change in a particular Go implementation.
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/metrics/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/metrics/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Value struct {
pointer unsafe.Pointer // contains non-scalar values.
}

// Kind returns the a tag representing the kind of value this is.
// Kind returns the tag representing the kind of value this is.
func (v Value) Kind() ValueKind {
return v.kind
}
Expand Down

0 comments on commit c9d6f45

Please sign in to comment.