diff options
author | Simon Rettberg | 2022-06-22 10:14:35 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-06-22 10:14:35 +0200 |
commit | 90b7f7ad1d452191d64ea4bab410fa4d998c41b1 (patch) | |
tree | bb1bcf68886af144452e0c0745c70bef9513bbdd /modules-available/statistics/pages | |
parent | [statistics] Update translations (diff) | |
download | slx-admin-90b7f7ad1d452191d64ea4bab410fa4d998c41b1.tar.gz slx-admin-90b7f7ad1d452191d64ea4bab410fa4d998c41b1.tar.xz slx-admin-90b7f7ad1d452191d64ea4bab410fa4d998c41b1.zip |
[statistics] Filter bogus memory speed hints
Sometimes (rounding) configured speed is 2666 while maximum is 2667.
Consider those equal.
Diffstat (limited to 'modules-available/statistics/pages')
-rw-r--r-- | modules-available/statistics/pages/hints.inc.php | 10 |
1 files changed, 8 insertions, 2 deletions
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]); |