]> Cypherpunks repositories - gostls13.git/commit
runtime,runtime/metrics: use explicit histogram boundaries
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 6 Jan 2021 23:05:22 +0000 (23:05 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 8 Jan 2021 03:43:44 +0000 (03:43 +0000)
commitae9771713383c1ee01a544cd50cfdbc22841380a
treeb6cf30b25d9ce1123073ef103594ec7017a919eb
parenta9ccd2d79574eead8c20d2bca4562cf2fd412787
runtime,runtime/metrics: use explicit histogram boundaries

This change modifies the semantics of
runtime/metrics.Float64Histogram.Buckets to remove implicit buckets to
that extend to positive and negative infinity and instead defines all
bucket boundaries as explicitly listed.

Bucket boundaries remain the same as before except
/gc/heap/allocs-by-size:objects and /gc/heap/frees-by-size:objects no
longer have a bucket that extends to negative infinity.

This change simplifies the Float64Histogram API, making it both easier
to understand and easier to use.

Also, add a test for allocs-by-size and frees-by-size that checks them
against MemStats.

Fixes #43443.

Change-Id: I5620f15bd084562dadf288f733c4a8cace21910c
Reviewed-on: https://go-review.googlesource.com/c/go/+/281238
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
src/runtime/histogram.go
src/runtime/metrics.go
src/runtime/metrics/histogram.go
src/runtime/metrics_test.go