From 6eef69e06eaa04e9b177b209a7105330226f5bc0 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Mon, 13 Jun 2011 20:41:41 +0200 Subject: [PATCH] bacula-web: Removed useless function Get_ElapsedTime_Job() in bweb.inc.php --- gui/bacula-web/includes/bweb.inc.php | 37 ---------------------------- gui/bacula-web/index.php | 3 --- 2 files changed, 40 deletions(-) diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index 60c1182fd4..34972a8852 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -374,43 +374,6 @@ class Bweb extends DB { return $hrsDiff . ':' . $minsDiff . ':' . $secsDiff; } - public function Get_ElapsedTime_Job( $delay = LAST_DAY ) - { - $query = ""; - $total_elapsed = 0; - - // Interval calculation - $end_date = mktime(); - $start_date = $end_date - $delay; - - $start_date = date( "Y-m-d H:i:s", $start_date ); - $end_date = date( "Y-m-d H:i:s", $end_date ); - - switch( $this->driver ) - { - case 'mysql': - $query = "SELECT UNIX_TIMESTAMP(EndTime) - UNIX_TIMESTAMP(StartTime) AS elapsed from Job "; - $query .= "WHERE EndTime BETWEEN '$start_date' AND '$end_date'"; - break; - } - $result = $this->db_link->query( $query ); - - if( PEAR::isError($result) ){ - die( "Unable to get elapsed time for jobs from catalog
query = $query
" . $result->getMessage() ); - }else { - while( $time = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) { - //echo 'elapsed = ' . $time['elapsed'] . '
'; - $total_elapsed += $time['elapsed']; - } - // Verify if elapsed time is more than 1 day - if ( $total_elapsed > LAST_DAY ) { - return date("%d days H:i:s", $total_elapsed ); - }else { - return date("H:i:s", $total_elapsed ); - } - } - } - // Return Jobs statistics for a specific interval such as // - Completed jobs number // - Failed jobs number diff --git a/gui/bacula-web/index.php b/gui/bacula-web/index.php index b459a08a4c..592fed14ee 100644 --- a/gui/bacula-web/index.php +++ b/gui/bacula-web/index.php @@ -72,9 +72,6 @@ $dbSql->tpl->assign( 'failed_jobs', $dbSql->CountJobs( LAST_DAY, 'failed' ) ); // Last 24 hours waiting jobs number $dbSql->tpl->assign( 'waiting_jobs', $dbSql->CountJobs( LAST_DAY, 'waiting' ) ); -// Last 24 hours elapsed time (last_run_report.tpl) -//$smarty->assign( 'elapsed_jobs', $dbSql->Get_ElapsedTime_Job() ); - // Last 24 hours Job Levels $dbSql->tpl->assign( 'incr_jobs', $dbSql->CountJobsbyLevel( LAST_DAY, 'I') ); $dbSql->tpl->assign( 'diff_jobs', $dbSql->CountJobsbyLevel( LAST_DAY, 'D') ); -- 2.39.5