The metrics /gc/heap/allocs-by-size:bytes, /gc/heap/frees-by-size:bytes, and /gc/pauses:seconds all have issues where the counts don't correctly line up with the buckets.
For the former two, it's the fact that the size classes have inclusive upper-bounds and exclusive lower-bounds while the API expects the opposite. For the latter, it's that the implicit bottom bucket representing the range of values (-inf, 0) isn't actually treated as a real bucket by the implementation. That bucket ends up containing 0-length durations. And there's an extra bucket at the top.
These are minor issues but should be fixed and tested.
The text was updated successfully, but these errors were encountered:
Currently these two metrics are reported incorrectly, going by the
documentation in the runtime/metrics package. We just copy in the
size-class-based values from the runtime wholesale, but those implicitly
have an inclusive upper-bound and exclusive lower-bound (e.g. 48-byte
size class contains objects in the size range (32, 48]) but the API
declares inclusive lower-bounds and exclusive upper-bounds.
Also, the bottom bucket representing (-inf, 1) should always be empty.
Extend the consistency check to verify this.
Run-TryBot: Michael Knyszek <firstname.lastname@example.org>
TryBot-Result: Go Bot <email@example.com>
Trust: Michael Knyszek <firstname.lastname@example.org>
Reviewed-by: Michael Pratt <email@example.com>