Skip to content
Permalink
Browse files

Merge branch 'MDL-37997-muc-stats-display' of git://github.com/mudrd8…

…mz/moodle
  • Loading branch information...
danpoltawski committed Feb 18, 2013
2 parents 35b5c04 + 08caae5 commit 858b3a2487a5a1f825a3809cead8d2f438617466
Showing with 21 additions and 7 deletions.
  1. +13 −4 lib/moodlelib.php
  2. +8 −3 theme/base/style/core.css
@@ -10665,24 +10665,33 @@ function get_performance_info() {
if ($stats = cache_helper::get_stats()) {
$html = '<span class="cachesused">';
$html .= '<span class="cache-stats-heading">Caches interaction by definition then store</span>';
$html .= '<span class="cache-stats-heading">Caches used (hits/misses/sets)</span>';
$text = 'Caches used (hits/misses/sets): ';
$hits = 0;
$misses = 0;
$sets = 0;
foreach ($stats as $definition => $stores) {
$html .= '<span class="cache-definition-stats">'.$definition.'</span>';
$html .= '<span class="cache-definition-stats">';
$html .= '<span class="cache-definition-stats-heading">'.$definition.'</span>';
$text .= "$definition {";
foreach ($stores as $store => $data) {
$hits += $data['hits'];
$misses += $data['misses'];
$sets += $data['sets'];
if ($data['hits'] == 0 and $data['misses'] > 0) {
$cachestoreclass = 'nohits';
} else if ($data['hits'] < $data['misses']) {
$cachestoreclass = 'lowhits';
} else {
$cachestoreclass = 'hihits';
}
$text .= "$store($data[hits]/$data[misses]/$data[sets]) ";
$html .= "<span class='cache-store-stats'>$store: $data[hits] / $data[misses] / $data[sets]</span>";
$html .= "<span class=\"cache-store-stats $cachestoreclass\">$store: $data[hits] / $data[misses] / $data[sets]</span>";
}
$html .= '</span>';
$text .= '} ';
}
$html .= "<span class='cache-total-stats'>Total Hits / Misses / Sets : $hits / $misses / $sets</span>";
$html .= "<span class='cache-total-stats'>Total: $hits / $misses / $sets</span>";
$html .= '</span> ';
$info['cachesused'] = "$hits / $misses / $sets";
$info['html'] .= $html;
@@ -206,10 +206,15 @@ a.skip:active {position: static;display: block;}
#page-footer .validators ul li {display:inline;margin-right:10px;margin-left:10px;}

.performanceinfo .cachesused {margin-top:1em;}
.performanceinfo .cachesused .cache-stats-heading {font-weight: bold;text-decoration: underline;font-size:110%;}
.performanceinfo .cachesused .cache-definition-stats {font-weight:bold;margin-top:0.3em;}
.performanceinfo .cachesused .cache-stats-heading {font-weight: bold;}
.performanceinfo .cachesused .cache-definition-stats {margin:0.3em; padding:0px;border:1px solid #999;float:left;min-height:4em;}
.performanceinfo .cachesused .cache-definition-stats span {padding-left:0.5em;padding-right:0.5em}
.performanceinfo .cachesused .cache-definition-stats .cache-definition-stats-heading {background-color:#eee;}
.performanceinfo .cachesused .cache-store-stats {text-indent: 1em;}
.performanceinfo .cachesused .cache-total-stats {font-weight:bold;margin-top:0.3em;}
.performanceinfo .cachesused .cache-store-stats.nohits {background-color:#ffd3d9;}
.performanceinfo .cachesused .cache-store-stats.lowhits {background-color:#f3f2aa;}
.performanceinfo .cachesused .cache-store-stats.hihits {background-color:#e7f1c3;}
.performanceinfo .cachesused .cache-total-stats {clear:both;font-weight:bold;margin-top:0.3em;}

#course-footer {clear:both;}

0 comments on commit 858b3a2

Please sign in to comment.
You can’t perform that action at this time.