mirror of
https://github.com/friendica/friendica
synced 2025-04-25 08:30:11 +00:00
Separate config options to display the worker jobs per minute
This commit is contained in:
parent
6436145909
commit
b0411b46c4
2 changed files with 18 additions and 10 deletions
|
@ -657,6 +657,19 @@ class Worker
|
|||
|
||||
$processlist = '';
|
||||
|
||||
if (Config::get('system', 'worker_jpm')) {
|
||||
$intervals = [1, 10, 60];
|
||||
$jobs_per_minute = [];
|
||||
foreach ($intervals as $interval) {
|
||||
$jobs = DBA::p("SELECT COUNT(*) AS `jobs` FROM `workerqueue` WHERE `done` AND `executed` > UTC_TIMESTAMP() - INTERVAL ".intval($interval)." MINUTE");
|
||||
if ($job = DBA::fetch($jobs)) {
|
||||
$jobs_per_minute[$interval] = number_format($job['jobs'] / $interval, 0);
|
||||
}
|
||||
DBA::close($jobs);
|
||||
}
|
||||
$processlist = ' - jpm: '.implode('/', $jobs_per_minute);
|
||||
}
|
||||
|
||||
if (Config::get('system', 'worker_debug')) {
|
||||
// Create a list of queue entries grouped by their priority
|
||||
$listitem = [];
|
||||
|
@ -686,16 +699,7 @@ class Worker
|
|||
}
|
||||
DBA::close($entries);
|
||||
|
||||
$intervals = [1, 10, 60];
|
||||
$jobs_per_minute = [];
|
||||
foreach ($intervals as $interval) {
|
||||
$jobs = DBA::p("SELECT COUNT(*) AS `jobs` FROM `workerqueue` WHERE `done` AND `executed` > UTC_TIMESTAMP() - INTERVAL ".intval($interval)." MINUTE");
|
||||
if ($job = DBA::fetch($jobs)) {
|
||||
$jobs_per_minute[$interval] = number_format($job['jobs'] / $interval, 0);
|
||||
}
|
||||
DBA::close($jobs);
|
||||
}
|
||||
$processlist = ' - jpm: '.implode('/', $jobs_per_minute).' ('.implode(', ', $listitem).')';
|
||||
$processlist .= ' ('.implode(', ', $listitem).')';
|
||||
}
|
||||
|
||||
$entries = self::totalEntries();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue