Changeset 926 for trunk/index.php

Show
Ignore:
Timestamp:
06/05/10 16:24:37 (2 years ago)
Author:
ort
Message:

fix + вынос статистики производительности из index.php в отдельный шаблон

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r895 r926  
    2121header('Content-Type: text/html; charset=utf-8'); 
    2222 
    23 $t1=microtime(true); 
    24  
    2523set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__)); 
    2624chdir(dirname(__FILE__)); 
     
    3634$oRouter->Exec(); 
    3735 
    38 $oEngine=Engine::getInstance(); 
    39 $aStats=$oEngine->getStats(); 
    40 $t2=microtime(true); 
    41  
    4236$oProfiler->Stop($iTimeId); 
    4337?> 
    44  
    45 <?php  
    46 $oUser=$oRouter->User_GetUserCurrent(); 
    47 if (Router::GetIsShowStats() and $oUser and $oUser->isAdministrator()) {  
    48 ?> 
    49 <fieldset> 
    50 <legend>Statistics performance</legend> 
    51 <table> 
    52         <tr align="top"> 
    53                 <td align="top"> 
    54                 <ul> 
    55         <li> 
    56         <b>MySql</b> <br> 
    57         &nbsp;&nbsp;&nbsp;query: <?php echo($aStats['sql']['count']);?><br> 
    58         &nbsp;&nbsp;&nbsp;time: <?php echo($aStats['sql']['time']);?><br><br><br> 
    59         </li> 
    60         </ul> 
    61                 </td> 
    62                 <td> 
    63                 <ul> 
    64         <li> 
    65         <b>Cache</b> <br> 
    66         &nbsp;&nbsp;&nbsp;query: <?php echo($aStats['cache']['count']);?><br> 
    67         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set: <?echo($aStats['cache']['count_set']);?><br> 
    68         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get: <?echo($aStats['cache']['count_get']);?><br> 
    69         &nbsp;&nbsp;&nbsp;time: <?php echo(round($aStats['cache']['time'],5));?> 
    70         </li> 
    71         </ul> 
    72                 </td> 
    73                 <td align="top"> 
    74                 <ul> 
    75         <li> 
    76         <b>PHP</b> <br>  
    77         &nbsp;&nbsp;&nbsp;time load modules:<?php echo($aStats['engine']['time_load_module']);?><br> 
    78         &nbsp;&nbsp;&nbsp;full time:<?php echo(round($t2-$t1,3));?><br><br><br> 
    79         </li> 
    80         </ul> 
    81                 </td> 
    82         </tr> 
    83 </table> 
    84 </fieldset> 
    85 <p align="center">Profiler: <?php print (Config::Get('sys.logs.profiler')) ? 'On' : 'Off'; ?> | <a href="<?php echo Router::GetPath('profiler');?>">Profiler reports</a></p> 
    86 <?php }?>