diff options
Diffstat (limited to 'modules-available/statistics/pages/hints.inc.php')
-rw-r--r-- | modules-available/statistics/pages/hints.inc.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/modules-available/statistics/pages/hints.inc.php b/modules-available/statistics/pages/hints.inc.php index 278c0e26..67c42a18 100644 --- a/modules-available/statistics/pages/hints.inc.php +++ b/modules-available/statistics/pages/hints.inc.php @@ -19,6 +19,10 @@ class SubPage self::showUnusedSpace($locs); } + /** + * Machines that have less than 8GB of RAM. Highlight those + * that still have free memory slots. + */ private static function showMemoryUpgrade(array $locs) { $q = new HardwareQuery(HardwareInfo::MAINBOARD); @@ -30,7 +34,8 @@ class SubPage $q->addGlobalColumn('Memory Maximum Capacity'); $q->addMachineColumn('clientip'); $q->addMachineColumn('hostname'); - $q->addWhere(false, 'Memory Installed Capacity', '<', 8 * 1024 * 1024 * 1024); + $col = $q->addLocalColumn('Memory Installed Capacity'); + $col->addCondition('<', 8 * 1024 * 1024 * 1024); $list = []; foreach ($q->query() as $row) { if (HardwareParser::convertSize($row['Memory Installed Capacity'], 'M', false) @@ -47,6 +52,10 @@ class SubPage Render::addTemplate('hints-ram-upgrade', ['list' => $list]); } + /** + * Show machines where RAM modules are running slower + * than their design speed. + */ private static function showMemorySlow(array $locs) { $q = new HardwareQuery(HardwareInfo::RAM_MODULE); @@ -62,11 +71,16 @@ class SubPage $q->addLocalColumn('Serial Number'); $q->addMachineColumn('clientip'); $q->addMachineColumn('hostname'); - $q->addCompare(true, 'Speed', '>', false, 'Configured Memory Speed'); + $col = $q->addGlobalColumn('Speed'); + $col->addCondition('>', $q->addLocalColumn('Configured Memory Speed')); $list = $q->query()->fetchAll(); Render::addTemplate('hints-ram-underclocked', ['list' => $list]); } + /** + * Show machines that have unpartitioned space available, + * and no ID44 or ID45. + */ private static function showUnusedSpace(array $locs) { $id44 = $id45 = []; @@ -77,7 +91,7 @@ class SubPage } $q->addMachineColumn('clientip'); $q->addMachineColumn('hostname'); - $q->addWhere(false, 'unused', '>', 2000000000); // 2 GB + $q->addLocalColumn('unused')->addCondition('>', 2000000000); // 2 GB $q->addMachineWhere('id44mb', '<', 20000); // 20 GB foreach ($q->query()->fetchAll() as $row) { $row['unused_s'] = Util::readableFileSize($row['unused']); @@ -91,7 +105,7 @@ class SubPage } $q->addMachineColumn('clientip'); $q->addMachineColumn('hostname'); - $q->addWhere(false, 'unused', '>', 25000000000); // 25 GB + $q->addLocalColumn('unused')->addCondition('>', 25000000000); // 25 GB $q->addMachineWhere('id44mb', '>', 20000); // 20 GB $q->addMachineWhere('id45mb', '<', 20000); // 20 GB foreach ($q->query()->fetchAll() as $row) { |