From ca80546ef7cae276d89bbcdab7fd9163cb0fa23b Mon Sep 17 00:00:00 2001 From: Georgy Buranov Date: Fri, 31 Mar 2023 18:25:32 +0200 Subject: [PATCH] take maximum processor Mhz (#16740) * take maximum processor Mhz * remove break * cl: add cl for 16740 --------- Co-authored-by: Seth Hoenig --- .changelog/16740.txt | 3 +++ helper/stats/cpu.go | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changelog/16740.txt diff --git a/.changelog/16740.txt b/.changelog/16740.txt new file mode 100644 index 000000000..7d85b5c7b --- /dev/null +++ b/.changelog/16740.txt @@ -0,0 +1,3 @@ +```release-note:improvement +client/fingerprint: detect fastest cpu core during cpu performance fallback +``` diff --git a/helper/stats/cpu.go b/helper/stats/cpu.go index 59cb6d12d..d2754204e 100644 --- a/helper/stats/cpu.go +++ b/helper/stats/cpu.go @@ -63,8 +63,9 @@ func Init() error { for _, infoStat := range cpuInfoStats { cpuModelName = infoStat.ModelName - cpuPowerCoreMHz = uint64(infoStat.Mhz) - break + if uint64(infoStat.Mhz) > cpuPowerCoreMHz { + cpuPowerCoreMHz = uint64(infoStat.Mhz) + } } // compute ticks using only power core, until we add support for