aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/metrics_test.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-01-07 17:24:39 +0000
committerMichael Knyszek <mknyszek@google.com>2021-01-08 16:28:15 +0000
commit32afcc94363e15ee2ef0cffec962191a15e73094 (patch)
tree106d625a8d69876dd69fc9c2fa806148df185e26 /src/runtime/metrics_test.go
parentc6513bca5aeaa9f9b6fe552d60f5b6c700ce0772 (diff)
downloadgo-32afcc94363e15ee2ef0cffec962191a15e73094.tar.gz
go-32afcc94363e15ee2ef0cffec962191a15e73094.zip
runtime/metrics: change unit on *-by-size metrics to match bucket unit
This change modifies the *-by-size metrics' units to be based off the bucket's unit (bytes) as opposed to the unit of the counts (objects). This convention is more in-line with distributions in other metrics systems. Change-Id: Id3b68a09f52f0e1ff9f4346f613ae1cbd9f52f73 Reviewed-on: https://go-review.googlesource.com/c/go/+/282352 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>
Diffstat (limited to 'src/runtime/metrics_test.go')
-rw-r--r--src/runtime/metrics_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/metrics_test.go b/src/runtime/metrics_test.go
index 5109058ed1..8a3cf019bd 100644
--- a/src/runtime/metrics_test.go
+++ b/src/runtime/metrics_test.go
@@ -70,7 +70,7 @@ func TestReadMetrics(t *testing.T) {
checkUint64(t, name, samples[i].Value.Uint64(), mstats.BuckHashSys)
case "/memory/classes/total:bytes":
checkUint64(t, name, samples[i].Value.Uint64(), mstats.Sys)
- case "/gc/heap/allocs-by-size:objects":
+ case "/gc/heap/allocs-by-size:bytes":
hist := samples[i].Value.Float64Histogram()
// Skip size class 0 in BySize, because it's always empty and not represented
// in the histogram.
@@ -84,7 +84,7 @@ func TestReadMetrics(t *testing.T) {
t.Errorf("histogram counts do not much BySize for class %d: got %d, want %d", i, c, m)
}
}
- case "/gc/heap/frees-by-size:objects":
+ case "/gc/heap/frees-by-size:bytes":
hist := samples[i].Value.Float64Histogram()
// Skip size class 0 in BySize, because it's always empty and not represented
// in the histogram.
@@ -161,9 +161,9 @@ func TestReadMetricsConsistency(t *testing.T) {
totalVirtual.got = samples[i].Value.Uint64()
case "/gc/heap/objects:objects":
objects.total = samples[i].Value.Uint64()
- case "/gc/heap/allocs-by-size:objects":
+ case "/gc/heap/allocs-by-size:bytes":
objects.alloc = samples[i].Value.Float64Histogram()
- case "/gc/heap/frees-by-size:objects":
+ case "/gc/heap/frees-by-size:bytes":
objects.free = samples[i].Value.Float64Histogram()
case "/gc/cycles:gc-cycles":
gc.numGC = samples[i].Value.Uint64()