aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/metrics.go
diff options
context:
space:
mode:
authorJes Cok <xigua67damn@gmail.com>2023-09-15 21:15:56 +0000
committerGopher Robot <gobot@golang.org>2023-09-18 20:01:34 +0000
commitf4e7675d1150cb683f3d2db7a96084b0d6e26e83 (patch)
tree340df6f82a5795fd470b3a0dc97b807178f99225 /src/runtime/metrics.go
parent3702cb5ab95575830488dc2b1ca9424651f828cf (diff)
downloadgo-f4e7675d1150cb683f3d2db7a96084b0d6e26e83.tar.xz
all: clean unnecessary casts
Run 'unconvert -safe -apply' (https://github.com/mdempsky/unconvert) Change-Id: I24b7cd7d286cddce86431d8470d15c5f3f0d1106 GitHub-Last-Rev: 022e75384c08bb899a8951ba0daffa0f2e14d5a7 GitHub-Pull-Request: golang/go#62662 Reviewed-on: https://go-review.googlesource.com/c/go/+/528696 Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/metrics.go')
-rw-r--r--src/runtime/metrics.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/metrics.go b/src/runtime/metrics.go
index 3d0f174133..86e0af4dea 100644
--- a/src/runtime/metrics.go
+++ b/src/runtime/metrics.go
@@ -221,11 +221,11 @@ func initMetrics() {
deps: makeStatDepSet(heapStatsDep),
compute: func(in *statAggregate, out *metricValue) {
hist := out.float64HistOrInit(sizeClassBuckets)
- hist.counts[len(hist.counts)-1] = uint64(in.heapStats.largeAllocCount)
+ hist.counts[len(hist.counts)-1] = in.heapStats.largeAllocCount
// Cut off the first index which is ostensibly for size class 0,
// but large objects are tracked separately so it's actually unused.
for i, count := range in.heapStats.smallAllocCount[1:] {
- hist.counts[i] = uint64(count)
+ hist.counts[i] = count
}
},
},
@@ -247,11 +247,11 @@ func initMetrics() {
deps: makeStatDepSet(heapStatsDep),
compute: func(in *statAggregate, out *metricValue) {
hist := out.float64HistOrInit(sizeClassBuckets)
- hist.counts[len(hist.counts)-1] = uint64(in.heapStats.largeFreeCount)
+ hist.counts[len(hist.counts)-1] = in.heapStats.largeFreeCount
// Cut off the first index which is ostensibly for size class 0,
// but large objects are tracked separately so it's actually unused.
for i, count := range in.heapStats.smallFreeCount[1:] {
- hist.counts[i] = uint64(count)
+ hist.counts[i] = count
}
},
},
@@ -306,7 +306,7 @@ func initMetrics() {
deps: makeStatDepSet(heapStatsDep),
compute: func(in *statAggregate, out *metricValue) {
out.kind = metricKindUint64
- out.scalar = uint64(in.heapStats.tinyAllocCount)
+ out.scalar = in.heapStats.tinyAllocCount
},
},
"/gc/limiter/last-enabled:gc-cycle": {
@@ -683,7 +683,7 @@ type gcStatsAggregate struct {
// compute populates the gcStatsAggregate with values from the runtime.
func (a *gcStatsAggregate) compute() {
a.heapScan = gcController.heapScan.Load()
- a.stackScan = uint64(gcController.lastStackScan.Load())
+ a.stackScan = gcController.lastStackScan.Load()
a.globalsScan = gcController.globalsScan.Load()
a.totalScan = a.heapScan + a.stackScan + a.globalsScan
}