getRows($db->q("SELECT status, count(*) as cnt FROM beathaven.queue GROUP BY status"));
$info = array_fill(0, 3, 0);
foreach ($rows as $row) {
$info[$row['status']] = $row['cnt'];
}
$tmp = array_slice(scandir(Config::get('app:Parser:bot_stats_dir')), 2);
$bots = array();
foreach($tmp as $bfile) {
$bots[str_replace('.json', '', $bfile)] = json_decode(file_get_contents(Config::get('app:Parser:bot_stats_dir').$bfile));
}
foreach($bots as $name => $bot) {
$tmp = exec("ps ".$bot->pid);
$bot->active = (int) (strpos($tmp, strval($bot->pid)) !== false);
}
?>
BeatHaven
= $info[6] ?>
/ = $info[3] ?> / = $info[2] ?>
|
Started |
Finished |
PID |
Good |
Bad |
Queue |
Last |
foreach($bots as $name => $bot): ?>
= $name ?> |
= date('Y-m-d H:i:s', $bot->started_job) ?> |
= ($bot->active ? '—' : date('Y-m-d H:i:s', $bot->eneded_job)) ?> |
= $bot->pid ?> |
= $bot->good_results ?> |
= $bot->bad_results ?> |
= $bot->queue_size ?> |
= $bot->last_request ?> |
endforeach; ?>
|