From e6b3126cfe3ba6716eb4144a77089e8baba8ee6d Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Tue, 5 Dec 2023 17:24:41 +0530 Subject: [PATCH 1/2] Add CPU count in metrics so that it can be used by the resource metrics collector to calculate "percentage" load (load * 100 / cpu-count) --- metrics.go | 1 + 1 file changed, 1 insertion(+) diff --git a/metrics.go b/metrics.go index 74f6bde..18f09c7 100644 --- a/metrics.go +++ b/metrics.go @@ -640,6 +640,7 @@ type CPUMetrics struct { TimesStat *cpu.TimesStat `json:"timesStat"` LoadStat *load.AvgStat `json:"loadStat"` + Count int `json:"count"` } // Merge other into 'm'. From 9e65565e93e40475b7faa4cf5da2b69301b4dcd7 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Tue, 5 Dec 2023 23:16:30 +0530 Subject: [PATCH 2/2] Rename Count to CPUCount --- metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics.go b/metrics.go index 18f09c7..222f14c 100644 --- a/metrics.go +++ b/metrics.go @@ -640,7 +640,7 @@ type CPUMetrics struct { TimesStat *cpu.TimesStat `json:"timesStat"` LoadStat *load.AvgStat `json:"loadStat"` - Count int `json:"count"` + CPUCount int `json:"cpuCount"` } // Merge other into 'm'.