示例#1
0
 /**
  * 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');
     }
 }