瀏覽代碼

N°800 Portal: log_kpi_duration / log_kpi_memory are now supported by the portal

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4640 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 8 年之前
父節點
當前提交
58f6caa386
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      datamodels/2.x/itop-portal-base/portal/web/index.php

+ 12 - 0
datamodels/2.x/itop-portal-base/portal/web/index.php

@@ -63,6 +63,7 @@ if (!defined('DISABLE_DATA_LOCALIZER_PORTAL'))
 $bDebug = (isset($_REQUEST['debug']) && ($_REQUEST['debug'] === 'true') );
 
 // Initializing Silex framework
+$oKPI = new ExecutionKPI();
 $oApp = new Silex\Application();
 
 // Registring optional silex components
@@ -80,6 +81,7 @@ $oApp->register(new Silex\Provider\TwigServiceProvider(), array(
 	)
 ));
 $oApp->register(new Silex\Provider\HttpFragmentServiceProvider());
+$oKPI->ComputeAndReport('Initialization of the Silex application');
 
 // Configuring Silex application
 $oApp['debug'] = $bDebug;
@@ -96,17 +98,27 @@ $oApp['combodo.portal.instance.routes'] = array();
 ApplicationHelper::RegisterExceptionHandler($oApp);
 
 // Preparing portal foundations (Can't use Silex autoload through composer as we don't follow PSR conventions -filenames, functions-)
+$oKPI = new ExecutionKPI();
 ApplicationHelper::LoadControllers();
 ApplicationHelper::LoadRouters();
 ApplicationHelper::RegisterRoutes($oApp);
 ApplicationHelper::LoadBricks();
 ApplicationHelper::LoadFormManagers();
 ApplicationHelper::RegisterTwigExtensions($oApp['twig']);
+$oKPI->ComputeAndReport('Loading portal files (routers, controllers, ...)');
 
 // Loading portal configuration from the module design
+$oKPI = new ExecutionKPI();
 ApplicationHelper::LoadPortalConfiguration($oApp);
+$oKPI->ComputeAndReport('Parsing portal configuration');
 // Loading current user
 ApplicationHelper::LoadCurrentUser($oApp);
 
 // Running application
+$oKPI = new ExecutionKPI();
 $oApp->run();
+$oKPI->ComputeAndReport('Page execution and rendering');
+
+// Logging trace and stats
+DBSearch::RecordQueryTrace();
+ExecutionKPI::ReportStats();