Exemplo n.º 1
0
 $view->assign('graph_stored_files', $graph->Render());
 unset($graph);
 // Get last 10 jobs list
 $query = "SELECT JobId, Level, JobFiles, JobBytes, ReadBytes, JobStatus, StartTime, EndTime, Name ";
 $query .= "FROM Job ";
 $query .= "WHERE Name = '{$backupjob_name}' ";
 $query .= "ORDER BY EndTime DESC ";
 $query .= "LIMIT 7 ";
 $jobs = array();
 $joblevel = array('I' => 'Incr', 'D' => 'Diff', 'F' => 'Full');
 $result = CDBUtils::runQuery($query, $dbSql->db_link);
 foreach ($result->fetchAll() as $job) {
     // Job level description
     $job['joblevel'] = $joblevel[$job['level']];
     // Job execution execution time
     $job['elapsedtime'] = DateTimeUtil::Get_Elapsed_Time($job['starttime'], $job['endtime']);
     // Compression
     if ($job['jobbytes'] > 0) {
         $compression = 1 - $job['jobbytes'] / $job['readbytes'];
         $job['compression'] = number_format($compression, 2);
     } else {
         $job['compression'] = 'N/A';
     }
     // Job speed
     $start = $job['starttime'];
     $end = $job['endtime'];
     $seconds = DateTimeUtil::get_ElaspedSeconds($end, $start);
     if ($seconds !== false && $seconds > 0) {
         $speed = $job['jobbytes'] / $seconds;
         $job['speed'] = CUtils::Get_Human_Size($speed, 2) . '/s';
     } else {
Exemplo n.º 2
0
     case J_NOT_RUNNING:
         $job['Job_icon'] = "time";
         break;
 }
 // end switch
 // Job start time, end time and elapsed time
 $start_time = $job['starttime'];
 $end_time = $job['endtime'];
 if ($start_time == '0000-00-00 00:00:00' or is_null($start_time) or $start_time == 0) {
     $job['starttime'] = 'n/a';
 }
 if ($end_time == '0000-00-00 00:00:00' or is_null($end_time) or $end_time == 0) {
     $job['endtime'] = 'n/a';
 }
 // Get the job elapsed time completion
 $job['elapsed_time'] = DateTimeUtil::Get_Elapsed_Time($start_time, $end_time);
 // Job Level
 $job['level'] = $job_levels[$job['level']];
 // Job files
 $job['jobfiles'] = CUtils::format_Number($job['jobfiles']);
 // Set default Job speed and compression rate
 $job['speed'] = '0 Mb/s';
 $job['compression'] = 'n/a';
 switch ($job['jobstatus']) {
     case J_COMPLETED:
     case J_COMPLETED_ERROR:
     case J_NO_FATAL_ERROR:
     case J_CANCELED:
         // Job speed
         $seconds = DateTimeUtil::get_ElaspedSeconds($end_time, $start_time);
         if ($seconds !== false && $seconds > 0) {