This commit is contained in:
Remi 2013-04-23 15:33:25 -04:00
commit 783dee3115

View File

@ -60,12 +60,12 @@ class ControllerHealthWorker extends Controller {
/* counter related stuff */ /* counter related stuff */
$db = Registry::get('db'); $db = Registry::get('db');
$db->select_db($db->database); $db->select_db($db->database);
list($archivesizeraw, $this->data['counters']) = $this->model_stat_counter->get_counters(); list($archivesizeraw, $this->data['counters']) = $this->model_stat_counter->get_counters();
$oldest_record_timestamp = $this->model_health_health->get_oldest_record_ts(); $oldest_record_timestamp = $this->model_health_health->get_oldest_record_ts();
$total_number_days = round( (time() - $oldest_record_timestamp) / 86400 ); $total_number_days = round( (time() - $oldest_record_timestamp) / 86400 );
@ -77,11 +77,11 @@ class ControllerHealthWorker extends Controller {
$this->data['sysinfo'] = $this->model_health_health->sysinfo(); $this->data['sysinfo'] = $this->model_health_health->sysinfo();
$this->data['options'] = $this->model_health_health->get_options(); $this->data['options'] = $this->model_health_health->get_options();
$sqlsizeraw = $this->model_health_health->get_database_size(); $sqlsizeraw = $this->model_health_health->get_database_size();
$sphinxsizeraw = $this->model_health_health->get_sphinx_size(); $sphinxsizeraw = $this->model_health_health->get_sphinx_size();
/* message count variables */ /* message count variables */
$averagemessagesweekraw = ($this->data['processed_emails'][1]) / 7; //average messages per day, computed over the past week $averagemessagesweekraw = ($this->data['processed_emails'][1]) / 7; //average messages per day, computed over the past week
$averagemessagesmonthraw = ($this->data['processed_emails'][2]) / 30; //average messages per day, computed over the past month $averagemessagesmonthraw = ($this->data['processed_emails'][2]) / 30; //average messages per day, computed over the past month
@ -97,7 +97,7 @@ class ControllerHealthWorker extends Controller {
foreach($this->data['shortdiskinfo'] as $part) { foreach($this->data['shortdiskinfo'] as $part) {
if( $part['partition'] == DATA_PARTITION ) { $datapart = $part['freespace']*1024; } // if the partition is the selected storage partition, record freespace on that partition if( $part['partition'] == DATA_PARTITION ) { $datapart = $part['freespace']*1024; } // if the partition is the selected storage partition, record freespace on that partition
} }
$this->data['oldestmessagets'] = $oldest_record_timestamp; // date of the oldest record in the db $this->data['oldestmessagets'] = $oldest_record_timestamp; // date of the oldest record in the db
$this->data['averagemessages'] = round($averagemessagesweekraw); // rounded average of messages over the past week $this->data['averagemessages'] = round($averagemessagesweekraw); // rounded average of messages over the past week
$this->data['averagemessagesize'] = nice_size($averagemessagesizeraw,' '); // formatted average message size on disk $this->data['averagemessagesize'] = nice_size($averagemessagesizeraw,' '); // formatted average message size on disk
@ -112,7 +112,7 @@ class ControllerHealthWorker extends Controller {
} else { } else {
$this->data['usagetrend'] = 0; $this->data['usagetrend'] = 0;
} }
$this->render(); $this->render();
} }