Excluded manual discovery tasks from server lag calculation

This commit is contained in:
Calvo 2023-03-29 14:31:34 +02:00
parent 5044c23ef3
commit 16d0e7057c
2 changed files with 4 additions and 2 deletions

View File

@ -983,12 +983,14 @@ function servers_get_info($id_server=-1)
'SELECT UNIX_TIMESTAMP() - utimestamp
FROM trecon_task
WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep)
AND interval_sweep > 0
AND id_recon_server = '.$server['id_server']
);
$server['module_lag'] = db_get_sql(
'SELECT COUNT(id_rt)
FROM trecon_task
WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep)
AND interval_sweep > 0
AND id_recon_server = '.$server['id_server']
);
} else {

View File

@ -5639,9 +5639,9 @@ sub pandora_server_statistics ($$) {
# Lag (take average active time of all active tasks)
$server->{"lag"} = get_db_value ($dbh, "SELECT UNIX_TIMESTAMP() - utimestamp from trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND id_recon_server = ?", $server->{"id_server"});
$server->{"lag"} = get_db_value ($dbh, "SELECT UNIX_TIMESTAMP() - utimestamp from trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND interval_sweep > 0 AND id_recon_server = ?", $server->{"id_server"});
$server->{"module_lag"} = get_db_value ($dbh, "SELECT COUNT(id_rt) FROM trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND id_recon_server = ?", $server->{"id_server"});
$server->{"module_lag"} = get_db_value ($dbh, "SELECT COUNT(id_rt) FROM trecon_task WHERE UNIX_TIMESTAMP() > (utimestamp + interval_sweep) AND interval_sweep AND id_recon_server = ?", $server->{"id_server"});
}
else {