Avoid performance tests if there are not enough modules in system

This commit is contained in:
fbsanchez 2021-01-11 18:32:44 +01:00
parent ed50126b1b
commit 73c182f65d
1 changed files with 11 additions and 0 deletions

View File

@ -45,6 +45,11 @@ enterprise_include_once('include/functions_cron.php');
class ConsoleSupervisor
{
/**
* Minimum modules to check performance.
*/
public const MIN_PERFORMANCE_MODULES = 100;
/**
* Show if console supervisor is enabled or not.
*
@ -1141,6 +1146,12 @@ class ConsoleSupervisor
$max_grown = ($total_modules[$queue['server_type']] * 0.40);
}
if ($total_modules[$queue['server_type']] < self::MIN_PERFORMANCE_MODULES) {
$this->cleanNotifications('NOTIF.SERVER.QUEUE.'.$key);
// Skip.
continue;
}
// Compare queue increments in a not over 900 seconds.
if (empty($previous[$key]['modules'])
|| ($time - $previous[$key]['utime']) > 900