mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 20:20:12 +01:00
performance improvement for the health page
This commit is contained in:
parent
c94959378a
commit
3be7ea4f47
@ -40,31 +40,27 @@ class ModelHealthHealth extends Model {
|
|||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
$ts = $now - 3600;
|
$ts = $now - 3600;
|
||||||
$query = $this->db->query("select count(*) as count, sum(size) as size from " . TABLE_META . " where arrived > $ts");
|
$query = $this->db->query("select count(*) as count from " . TABLE_META . " where arrived > $ts");
|
||||||
if(isset($query->row['count'])) {
|
if(isset($query->row['count'])) {
|
||||||
$a['last_60_mins_count'] = $query->row['count'];
|
$a['last_60_mins_count'] = $query->row['count'];
|
||||||
$a['last_60_mins_size'] = $query->row['size'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ts = $now - 86400;
|
$ts = $now - 86400;
|
||||||
$query = $this->db->query("select count(*) as count, sum(size) as size from " . TABLE_META . " where arrived > $ts");
|
$query = $this->db->query("select count(*) as count from " . TABLE_META . " where arrived > $ts");
|
||||||
if(isset($query->row['count'])) {
|
if(isset($query->row['count'])) {
|
||||||
$a['today_count'] = $query->row['count'];
|
$a['today_count'] = $query->row['count'];
|
||||||
$a['today_size'] = $query->row['size'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ts = $now - 604800;
|
$ts = $now - 604800;
|
||||||
$query = $this->db->query("select count(*) as count, sum(size) as size from " . TABLE_META . " where arrived > $ts");
|
$query = $this->db->query("select count(*) as count from " . TABLE_META . " where arrived > $ts");
|
||||||
if(isset($query->row['count'])) {
|
if(isset($query->row['count'])) {
|
||||||
$a['last_7_days_count'] = $query->row['count'];
|
$a['last_7_days_count'] = $query->row['count'];
|
||||||
$a['last_7_days_size'] = $query->row['size'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ts = $now - 2592000;
|
$ts = $now - 2592000;
|
||||||
$query = $this->db->query("select count(*) as count, sum(size) as size from " . TABLE_META . " where arrived > $ts");
|
$query = $this->db->query("select count(*) as count from " . TABLE_META . " where arrived > $ts");
|
||||||
if(isset($query->row['count'])) {
|
if(isset($query->row['count'])) {
|
||||||
$a['last_30_days_count'] = $query->row['count'];
|
$a['last_30_days_count'] = $query->row['count'];
|
||||||
$a['last_30_days_size'] = $query->row['size'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $a;
|
return $a;
|
||||||
|
@ -113,10 +113,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><?php print $text_processed_emails; ?></td>
|
<td><?php print $text_processed_emails; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php print $processed_emails['last_60_mins_count']; ?> / <?php print nice_size($processed_emails['last_60_mins_size']); ?> (<?php print $text_60_minutes; ?>)<br />
|
<?php print $processed_emails['last_60_mins_count']; ?> (<?php print $text_60_minutes; ?>)<br />
|
||||||
<?php print $processed_emails['today_count']; ?> / <?php print nice_size($processed_emails['today_size']); ?> (<?php print $text_24_hours; ?>)<br />
|
<?php print $processed_emails['today_count']; ?> (<?php print $text_24_hours; ?>)<br />
|
||||||
<?php print $processed_emails['last_7_days_count']; ?> / <?php print nice_size($processed_emails['last_7_days_size']); ?> (<?php print $text_1_week; ?>)<br />
|
<?php print $processed_emails['last_7_days_count']; ?> (<?php print $text_1_week; ?>)<br />
|
||||||
<?php print $processed_emails['last_30_days_count']; ?> / <?php print nice_size($processed_emails['last_30_days_size']); ?> (<?php print $text_30_days; ?>)
|
<?php print $processed_emails['last_30_days_count']; ?> (<?php print $text_30_days; ?>)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -58,10 +58,10 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="cellhealthleft"><?php print $text_processed_emails; ?></div>
|
<div class="cellhealthleft"><?php print $text_processed_emails; ?></div>
|
||||||
<div class="cellhealthright">
|
<div class="cellhealthright">
|
||||||
<?php print $processed_emails['last_60_mins_count']; ?> / <?php print nice_size($processed_emails['last_60_mins_size']); ?> (<?php print $text_60_minutes; ?>)<br />
|
<?php print $processed_emails['last_60_mins_count']; ?> (<?php print $text_60_minutes; ?>)<br />
|
||||||
<?php print $processed_emails['today_count']; ?> / <?php print nice_size($processed_emails['today_size']); ?> (<?php print $text_24_hours; ?>)<br />
|
<?php print $processed_emails['today_count']; ?> (<?php print $text_24_hours; ?>)<br />
|
||||||
<?php print $processed_emails['last_7_days_count']; ?> / <?php print nice_size($processed_emails['last_7_days_size']); ?> (<?php print $text_1_week; ?>)<br />
|
<?php print $processed_emails['last_7_days_count']; ?> (<?php print $text_1_week; ?>)<br />
|
||||||
<?php print $processed_emails['last_30_days_count']; ?> / <?php print nice_size($processed_emails['last_30_days_size']); ?> (<?php print $text_30_days; ?>)
|
<?php print $processed_emails['last_30_days_count']; ?> (<?php print $text_30_days; ?>)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user