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

@@ -26,7 +26,9 @@ class JsonPage extends WebPage
*/
public function __construct()
{
$oKpi = new ExecutionKPI();
parent::__construct('');
$oKpi->ComputeStats(get_class($this).' creation', 'JsonPage');
}
/**
@@ -89,13 +91,12 @@ class JsonPage extends WebPage
$aScripts = array_merge($this->a_init_scripts, $this->a_scripts, $this->a_ready_scripts);
$aJson = $this->bOutputDataOnly ? $this->aData : [
'data' => $this->aData,
'data' => $this->aData,
'scripts' => $aScripts,
];
$oKpi->ComputeAndReport(get_class($this).' prepare output');
$oKpi = new ExecutionKPI();
$sJSON = json_encode($aJson);
$oKpi->ComputeAndReport(get_class($this).' output');
echo $sJSON;
$oKpi->ComputeAndReport('Echoing ('.round(strlen($sJSON) / 1024).' Kb)');
ExecutionKPI::ReportStats();