N°3985 - Performance checks on the back end - Enhance KPIs

This commit is contained in:
Eric Espie
2021-09-09 17:21:50 +02:00
parent 27c397cc1a
commit 15e99a898e
22 changed files with 119 additions and 78 deletions

View File

@@ -67,6 +67,7 @@ class UnauthenticatedWebPage extends NiceWebPage
*/
public function __construct($s_title, $bPrintable = false)
{
$oKpi = new ExecutionKPI();
parent::__construct($s_title, $bPrintable);
$this->sContent = '';
@@ -96,6 +97,7 @@ class UnauthenticatedWebPage extends NiceWebPage
// Default theme
$this->add_saas('css/unauthenticated.scss');
$oKpi->ComputeStats(get_class($this).' creation', $s_title);
}
/**
@@ -111,6 +113,7 @@ class UnauthenticatedWebPage extends NiceWebPage
*/
public function output()
{
$oKpi = new ExecutionKPI();
// Send headers
foreach ($this->a_headers as $sHeader) {
header($sHeader);
@@ -172,8 +175,9 @@ class UnauthenticatedWebPage extends NiceWebPage
// Render final TWIG into global HTML
$sHtml = TwigHelper::RenderTemplate($oTwigEnv, $aData, $this->GetTemplateRelPath());
$oKpi->ComputeAndReport(get_class($this).' output');
echo $sHtml;
$oKpi->ComputeAndReport('Echoing ('.round(strlen($sHtml) / 1024).' Kb)');
}
/**