diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2022-01-21 06:52:43 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2022-02-10 00:07:14 +0000 |
commit | 2e9dcb508647dc473a37ecfa244d2bc4a1843ab4 (patch) | |
tree | 226bff50124279335293c045c90ef7c3735ede27 /src/runtime/export_test.go | |
parent | 2bf5ae0c28a28244c3e20ef65b75e9e90adb5251 (diff) | |
download | go-2e9dcb508647dc473a37ecfa244d2bc4a1843ab4.tar.gz go-2e9dcb508647dc473a37ecfa244d2bc4a1843ab4.zip |
runtime: simplify histogram buckets considerably
There was an off-by-one error in the time histogram buckets calculation
that caused the linear sub-buckets distances to be off by 2x.
The fix was trivial, but in writing tests I realized there was a much
simpler way to express the calculation for the histogram buckets, and
took the opportunity to do that here. The new bucket calculation also
fixes the bug.
Fixes #50732.
Change-Id: Idae89986de1c415ee4e148f778e0e101ca003ade
Reviewed-on: https://go-review.googlesource.com/c/go/+/380094
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r-- | src/runtime/export_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index 0f21838721..83b7f86ef8 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -1199,6 +1199,8 @@ func (th *TimeHistogram) Record(duration int64) { (*timeHistogram)(th).record(duration) } +var TimeHistogramMetricsBuckets = timeHistogramMetricsBuckets + func SetIntArgRegs(a int) int { lock(&finlock) old := intArgRegs |