Skip to content

Commit

Permalink
Make full caches more notable.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaSourcerer committed Mar 23, 2012
1 parent c715e59 commit 00952e8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions apcinfo/assets/css/stats.css
@@ -0,0 +1 @@
tr.full td { color: red; font-weight: bold }
32 changes: 28 additions & 4 deletions apcinfo/views/apc/_statistics.php
@@ -1,4 +1,5 @@
<?php Yii::app()->getClientScript()->registerCssFile($this->module->getAssetsUrl() . '/fragmentation.css'); ?> <?php Yii::app()->getClientScript()->registerCssFile($this->module->getAssetsUrl() . '/fragmentation.css'); ?>
<?php Yii::app()->getClientScript()->registerCssFile($this->module->getAssetsUrl() . '/stats.css'); ?>
<div class="column span-12"> <div class="column span-12">
<?php $this->beginWidget('zii.widgets.CPortlet', array( <?php $this->beginWidget('zii.widgets.CPortlet', array(
'title'=>'General Information', 'title'=>'General Information',
Expand Down Expand Up @@ -37,7 +38,19 @@
'hit_rate:rate', 'hit_rate:rate',
'miss_rate:rate', 'miss_rate:rate',
'insert_rate:rate', 'insert_rate:rate',
'cache_full_count:number:Cache full count', array(
'name'=>'cache_full_count',
'type'=>'number',
'label'=>'Cache full count',
'cssClass'=>'full',
'visible'=>($fileCache['cache_full_count']>0),
),
array(
'name'=>'cache_full_count',
'type'=>'number',
'label'=>'Cache full count',
'visible'=>($fileCache['cache_full_count']==0),
),
), ),
)); ?> )); ?>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
Expand All @@ -59,7 +72,19 @@
'hit_rate:rate', 'hit_rate:rate',
'miss_rate:rate', 'miss_rate:rate',
'insert_rate:rate', 'insert_rate:rate',
'cache_full_count:number:Cache full count', array(
'name'=>'cache_full_count',
'type'=>'number',
'label'=>'Cache full count',
'cssClass'=>'full',
'visible'=>($userCache['cache_full_count']>0),
),
array(
'name'=>'cache_full_count',
'type'=>'number',
'label'=>'Cache full count',
'visible'=>($userCache['cache_full_count']==0),
),
), ),
)); ?> )); ?>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
Expand All @@ -76,9 +101,8 @@
foreach($blocks as $block) foreach($blocks as $block)
echo CHtml::tag('div', array( echo CHtml::tag('div', array(
'class'=>$block['free'] ? 'free' : 'used', 'class'=>$block['free'] ? 'free' : 'used',
//'style'=>"width: round({$block['percent']})%",
'style'=>'width: '.(int)$block['percent'].'%', 'style'=>'width: '.(int)$block['percent'].'%',
'title'=>"Block with {$formatter->formatDatasize($block['size'])} (Segment {$block['segment']} | Offset {$formatter->formatNumber($block['offset'])})", 'title'=>($block['free'] ? 'Free' : 'Used') . " block with {$formatter->formatDatasize($block['size'])} (Segment {$block['segment']} | Offset {$formatter->formatNumber($block['offset'])})",
), '', true); ), '', true);
?> ?>
</div> </div>
Expand Down

0 comments on commit 00952e8

Please sign in to comment.