Top: each CPU's own wattage on a two-socket machine, its threads folded under it

Per-package RAPL watts in the sample, the process table and as cpu.package.N.power
sensors. The socket rows collapse with an arrow; the fold is remembered per browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-11-10 00:07:24 -08:00
co-authored by Claude Opus 5.5
parent 1e2dcacb2c
commit e9a87af5e8
7 changed files with 131 additions and 62 deletions
+15
View File
@@ -43,6 +43,21 @@ func fold(b []Sample) Sample {
if pn > 0 {
out.CPUPower = round1(pw / pn)
}
// and each package's, the same way
out.CPUPowerPkgs = nil
for _, s := range b {
for i, w := range s.CPUPowerPkgs {
for len(out.CPUPowerPkgs) <= i {
out.CPUPowerPkgs = append(out.CPUPowerPkgs, 0)
}
out.CPUPowerPkgs[i] += w
}
}
if pn > 0 {
for i := range out.CPUPowerPkgs {
out.CPUPowerPkgs[i] = round1(out.CPUPowerPkgs[i] / pn)
}
}
out.Load[0] = sum(func(s Sample) float64 { return s.Load[0] })
out.Load[1] = sum(func(s Sample) float64 { return s.Load[1] })
out.Load[2] = sum(func(s Sample) float64 { return s.Load[2] })