Changeset 1058 for trunk/htdocs/cacher/cacher.php
- Timestamp:
- 2012-07-27T10:10:24+02:00 (10 months ago)
- File:
-
- 1 edited
-
trunk/htdocs/cacher/cacher.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/cacher/cacher.php
r1053 r1058 92 92 } 93 93 94 function hits_to_graph($hits)95 { 96 $max = 0;97 foreach ($hits as $v) {98 if ($max < $v) {99 $max = $v;100 }94 function get_cache_hits_graph($ci, $key) 95 { 96 if ($ci['cacheid'] == -1) { 97 $max = max($ci[$key]); 98 } 99 else { 100 $max = $GLOBALS['maxhits_by_hour'][$ci['type']]; 101 101 } 102 102 if (!$max) { 103 return '';103 $max = 1; 104 104 } 105 105 $t = (time() / (60 * 60)) % 24; 106 106 $html = array(); 107 foreach ($ hitsas $i => $v) {107 foreach ($ci[$key] as $i => $v) { 108 108 $html[] = bar_hits_percent($v, $v / $max, $i == $t); 109 109 } … … 185 185 $cacheinfos = array(); 186 186 $total = array(); 187 $maxhits_by_hour = array(0, 0); 187 188 for ($i = 0; $i < $pcnt; $i ++) { 188 189 $data = xcache_info(XC_TYPE_PHP, $i); … … 194 195 $data['cacheid'] = $i; 195 196 $cacheinfos[] = $data; 197 $maxhits_by_hour[XC_TYPE_PHP] = max($maxhits_by_hour[XC_TYPE_PHP], max($data['hits_by_hour'])); 196 198 if ($pcnt >= 2) { 197 199 calc_total($total, $data); … … 218 220 $data['cacheid'] = $i; 219 221 $cacheinfos[] = $data; 222 $maxhits_by_hour[XC_TYPE_VAR] = max($maxhits_by_hour[XC_TYPE_VAR], max($data['hits_by_hour'])); 220 223 if ($vcnt >= 2) { 221 224 calc_total($total, $data);
Note: See TracChangeset
for help on using the changeset viewer.

