From 0bcd651a99ef4789eb83eaeee147224b617a3e95 Mon Sep 17 00:00:00 2001 From: Jon Poole Date: Sun, 26 Nov 2023 18:04:16 +0000 Subject: [PATCH] lint --- src/core/graph_benchmark_test.go | 2 +- src/core/resources.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/graph_benchmark_test.go b/src/core/graph_benchmark_test.go index c896f5f1ba..c5709778da 100644 --- a/src/core/graph_benchmark_test.go +++ b/src/core/graph_benchmark_test.go @@ -84,7 +84,7 @@ func createTargets(n int) []*BuildTarget { targets := make([]*BuildTarget, n) seen := map[BuildLabel]bool{} - rand.Seed(42) // Make sure it does the same thing every time. + rand.New(rand.NewSource(42)) // Make sure it does the same thing every time. components := []string{ "src", "main", "cmd", "tools", "utils", "common", "query", "process", "update", diff --git a/src/core/resources.go b/src/core/resources.go index b86ca18fab..d1600d4676 100644 --- a/src/core/resources.go +++ b/src/core/resources.go @@ -80,5 +80,8 @@ func getCPUTimes() (float64, float64) { return 0.0, 0.0 } t := ts[0] - return t.Total() - t.Idle - t.Iowait, t.Iowait + + total := t.User + t.System + t.Idle + t.Nice + t.Iowait + t.Irq + + t.Softirq + t.Steal + t.Guest + t.GuestNice + return total - t.Idle - t.Iowait, t.Iowait }