本文整理匯總了PHP中CronTask::getStats方法的典型用法代碼示例。如果您正苦於以下問題:PHP CronTask::getStats方法的具體用法?PHP CronTask::getStats怎麽用?PHP CronTask::getStats使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CronTask
的用法示例。
在下文中一共展示了CronTask::getStats方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stats
/**
* Display Some statistics about Finished Jobs.
*
* @return void
*/
public function stats()
{
$this->out('Jobs currenty in the Queue:');
$types = $this->CronTask->getTypes();
foreach ($types as $type) {
$this->out(" " . str_pad($type, 20, ' ', STR_PAD_RIGHT) . ": " . $this->CronTask->getLength($type));
}
$this->hr();
$this->out('Total unfinished Jobs : ' . $this->CronTask->getLength());
$this->hr();
$this->out('Finished Job Statistics:');
$data = $this->CronTask->getStats();
foreach ($data as $item) {
$this->out(" " . $item['CronTask']['jobtype'] . ": ");
$this->out(" Finished Jobs in Database: " . $item[0]['num']);
$this->out(" Average Job existence : " . $item[0]['alltime'] . 's');
$this->out(" Average Execution delay : " . $item[0]['fetchdelay'] . 's');
$this->out(" Average Execution time : " . $item[0]['runtime'] . 's');
}
}