stored counter stats

This commit is contained in:
SJ
2014-05-05 16:00:33 +02:00
parent 3bf589ab5c
commit f356574ea5
9 changed files with 16 additions and 9 deletions

View File

@ -64,12 +64,13 @@ class ControllerHealthWorker extends Controller {
$db = Registry::get('db');
$db->select_db($db->database);
list($archivesizeraw, $this->data['counters']) = $this->model_stat_counter->get_counters();
list($archivesizeraw, $archivestoredsizeraw, $this->data['counters']) = $this->model_stat_counter->get_counters();
$oldest_record_timestamp = $this->model_health_health->get_oldest_record_ts();
$total_number_days = round( (time() - $this->model_health_health->get_first_email_arrival_ts()) / 86400 );
$this->data['archive_size'] = nice_size($archivesizeraw, ' ');
$this->data['archive_stored_size'] = nice_size($archivestoredsizeraw, ' ');
$this->data['prefix'] = '';
if(isset($this->data['counters'][MEMCACHED_PREFIX . 'rcvd'])) { $this->data['prefix'] = MEMCACHED_PREFIX; }

View File

@ -13,9 +13,11 @@ class ModelStatCounter extends Model {
if(isset($counter[MEMCACHED_PREFIX . 'counters_last_update'])) {
if(isset($counter[MEMCACHED_PREFIX . 'size'])) { $asize = $counter[MEMCACHED_PREFIX . 'size']; }
if(isset($counter[MEMCACHED_PREFIX . 'stored_size'])) { $ssize = $counter[MEMCACHED_PREFIX . 'stored_size']; }
unset($counter[MEMCACHED_PREFIX . 'size']);
unset($counter[MEMCACHED_PREFIX . 'stored_size']);
return array ($asize, $counter);
return array ($asize, $ssize, $counter);
}
}
@ -23,13 +25,15 @@ class ModelStatCounter extends Model {
if($query->num_rows == 1) {
$asize = $query->row['size'];
$ssize = $query->row['stored_size'];
unset($query->row['size']);
unset($query->row['stored_size']);
$counter = $query->row;
}
return array ($asize, $counter);
return array ($asize, $ssize, $counter);
}

View File

@ -40,7 +40,7 @@
<table class="table table-striped">
<tr>
<th><?php print $text_archive_size; ?>:</th>
<td><?php print $archive_size; ?>B</td>
<td><?php print $archive_size; ?>B (<?php print $archive_stored_size; ?>B)</td>
</tr>
<tr>

View File

@ -31,7 +31,7 @@
<div class="row">
<div class="cellhealthleft"><?php print $text_archive_size; ?></div>
<div class="cellhealthright"><?php print $archive_size; ?>B</div>
<div class="cellhealthright"><?php print $archive_size; ?>B (<?php print $archive_stored_size; ?>B)</div>
</div>
<div class="row">