From 90b7f7ad1d452191d64ea4bab410fa4d998c41b1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 22 Jun 2022 10:14:35 +0200 Subject: [statistics] Filter bogus memory speed hints Sometimes (rounding) configured speed is 2666 while maximum is 2667. Consider those equal. --- modules-available/statistics/pages/hints.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules-available/statistics/pages') diff --git a/modules-available/statistics/pages/hints.inc.php b/modules-available/statistics/pages/hints.inc.php index 935315d6..cc44caa9 100644 --- a/modules-available/statistics/pages/hints.inc.php +++ b/modules-available/statistics/pages/hints.inc.php @@ -20,7 +20,7 @@ class SubPage self::showMemorySlow($locs); } - private static function isNonClientRunmode(string $machineUuid) + private static function isNonClientRunmode(string $machineUuid): bool { static $cache = null; if ($cache === null) { @@ -90,7 +90,13 @@ class SubPage $q->addMachineColumn('hostname'); $col = $q->addGlobalColumn('Speed'); $col->addCondition('>', $q->addLocalColumn('Configured Memory Speed')); - $list = $q->query(['machineuuid', 'Size', 'Manufacturer', 'Speed', 'Configured Memory Speed'])->fetchAll(); + $list = []; + foreach ($q->query(['machineuuid', 'Size', 'Manufacturer', 'Speed', 'Configured Memory Speed']) as $row) { + // Sometimes configured speed reports as 2666 while rated speed is 2667 + if ($row['Configured Memory Speed'] + 33 >= $row['Speed']) + continue; + $list[] = $row; + } if (empty($list)) return; Render::addTemplate('hints-ram-underclocked', ['list' => $list]); -- cgit v1.2.3-55-g7522