From 490bdec65fb310c4c47e13800f92d882bf6a3f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20W=2E=20Baul=C3=A9?= Date: Mon, 28 Aug 2023 12:23:24 -0300 Subject: [PATCH] oops, it's cur not current --- cpu/cpu_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/cpu_linux.go b/cpu/cpu_linux.go index 08765af..8e98284 100644 --- a/cpu/cpu_linux.go +++ b/cpu/cpu_linux.go @@ -141,7 +141,7 @@ func finishCPUInfo(ctx context.Context, c *InfoStat) { } } - c.Mhz.Current = fillMhz(ctx, "current", c) + c.Mhz.Current = fillMhz(ctx, "cur", c) c.Mhz.Min = fillMhz(ctx, "min", c) c.Mhz.Max = fillMhz(ctx, "max", c) @@ -153,7 +153,7 @@ func fillMhz(ctx context.Context, value string, c *InfoStat) float64 { var line float64 var mhz float64 = 0 - if value == "min" || value == "max" || value == "current" { + if value == "min" || value == "max" || value == "cur" { lines, err = common.ReadLines(sysCPUPath(ctx, c.CPU, fmt.Sprintf("cpufreq/cpuinfo_%s_freq", value))) // if we encounter errors below such as there are no cpuinfo_max_freq file, // we just ignore. so let Mhz is 0.