Changeset 926
- Timestamp:
- 06/05/10 16:24:37 (20 months ago)
- Location:
- trunk
- Files:
-
- 7 added
- 4 modified
-
classes/hooks/HookStatisticsPerformance.class.php (added)
-
engine/classes/Engine.class.php (modified) (3 diffs)
-
engine/classes/Hook.class.php (modified) (1 diff)
-
index.php (modified) (2 diffs)
-
plugins/profiler/classes/hooks/HookProfiler.class.php (added)
-
plugins/profiler/templates/skin/default/link.tpl (added)
-
plugins/profiler/templates/skin/developer/link.tpl (added)
-
plugins/profiler/templates/skin/new/link.tpl (added)
-
templates/skin/developer/header_top.tpl (modified) (1 diff)
-
templates/skin/developer/statistics_performance.tpl (added)
-
templates/skin/new/statistics_performance.tpl (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/engine/classes/Engine.class.php
r907 r926 41 41 protected $aConfigModule; 42 42 public $iTimeLoadModule=0; 43 protected $iTimeInit=null; 43 44 44 45 /** … … 54 55 */ 55 56 protected function __construct() { 57 $this->iTimeInit=microtime(true); 56 58 if (get_magic_quotes_gpc()) { 57 59 func_stripslashes($_REQUEST); … … 394 396 public function getStats() { 395 397 return array('sql'=>$this->Database_GetStats(),'cache'=>$this->Cache_GetStats(),'engine'=>array('time_load_module'=>round($this->iTimeLoadModule,3))); 398 } 399 400 public function GetTimeInit() { 401 return $this->iTimeInit; 396 402 } 397 403 -
trunk/engine/classes/Hook.class.php
r818 r926 26 26 } 27 27 28 protected function AddHook($sName,$sCallBack,$sClassNameHook,$iPriority=1) { 28 protected function AddHook($sName,$sCallBack,$sClassNameHook=null,$iPriority=1) { 29 if (is_null($sClassNameHook)) { 30 $sClassNameHook=get_class($this); 31 } 29 32 $this->Hook_AddExecHook($sName,$sCallBack,$iPriority,array('sClassName'=>$sClassNameHook)); 30 33 } 31 34 32 protected function AddDelegateHook($sName,$sCallBack,$sClassNameHook,$iPriority=1) { 35 protected function AddDelegateHook($sName,$sCallBack,$sClassNameHook=null,$iPriority=1) { 36 if (is_null($sClassNameHook)) { 37 $sClassNameHook=get_class($this); 38 } 33 39 $this->Hook_AddDelegateHook($sName,$sCallBack,$iPriority,array('sClassName'=>$sClassNameHook)); 34 40 } -
trunk/index.php
r895 r926 21 21 header('Content-Type: text/html; charset=utf-8'); 22 22 23 $t1=microtime(true);24 25 23 set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__)); 26 24 chdir(dirname(__FILE__)); … … 36 34 $oRouter->Exec(); 37 35 38 $oEngine=Engine::getInstance();39 $aStats=$oEngine->getStats();40 $t2=microtime(true);41 42 36 $oProfiler->Stop($iTimeId); 43 37 ?> 44 45 <?php46 $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 query: <?php echo($aStats['sql']['count']);?><br>58 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 query: <?php echo($aStats['cache']['count']);?><br>67 set: <?echo($aStats['cache']['count_set']);?><br>68 get: <?echo($aStats['cache']['count_get']);?><br>69 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 time load modules:<?php echo($aStats['engine']['time_load_module']);?><br>78 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 }?> -
trunk/templates/skin/developer/header_top.tpl
r923 r926 45 45 </div> 46 46 47 48 {* ���*} 47 49 48 <h1><a href="{cfg name='path.root.web'}">LiveStreet</a></h1> 50 49 51 52 {* �����*} 50 53 51 <ul class="pages"> 54 52 <li {if $sMenuHeadItemSelect=='blog'}class="active"{/if}><a href="{router page='blog'}">{$aLang.clean_posts}</a></li> 55 53 <li {if $sMenuHeadItemSelect=='blogs'}class="active"{/if}><a href="{router page='blogs'}">{$aLang.blogs}</a></li> 56 54 <li {if $sMenuHeadItemSelect=='people'}class="active"{/if}><a href="{router page='people'}">{$aLang.people}</a></li> 57 58 {* ��������Page" *} 55 59 56 {if $aPluginActive.page} 60 57 <li {if $sAction=='page' and $sEvent=='about'}class="active"{/if}><a href="{router page='page'}about/">{$aLang.page_about}</a></li>
