]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: fix allocs-by-size and frees-by-size buckets
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 22 Dec 2020 16:23:29 +0000 (16:23 +0000)
committerMichael Knyszek <mknyszek@google.com>
Wed, 23 Dec 2020 17:31:08 +0000 (17:31 +0000)
commit8db7e2fecdcd04af31c82d075c60ab6fdf6b7a48
tree8cd8a0a16b0fff83e7099af14cc48293008c1937
parentfb96f07e1a45b9ec41158732a34aee8c2ccc2eaf
runtime: fix allocs-by-size and frees-by-size buckets

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.

Updates #43329.

Change-Id: I11b5b062a34e13405ab662d15334bda91f779775
Reviewed-on: https://go-review.googlesource.com/c/go/+/279467
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.go
src/runtime/metrics_test.go