Add Execution time and memory to CProfileLogRoute firebug

I am using the CProfileLogRoute class and outputting to firebug. However there is a minor but handy bit missing from the firebug profile view file (profile-summary-firebug.php) that exists in the non firebug view (profile-summary.php)

The summary titles are different. In the non-firebug version you get a summary like

"Profiling Summary Report (Time: 10.04860s, Memory: 2,042KB)" The total Time and Memory is missing from the firebug version.

I have added the following code but obviously i don’t really want to touch any of the core yii framework files.

I changed (in yii/views/profile-summary-firebug.php):


console.group("Profiling Summary Report");

To:




	<?php 

		$pTitle = "Profiling Summary Report (Time: " 

			. sprintf('%0.5f',Yii::getLogger()->getExecutionTime()) . "s," 

			. " Memory: " . number_format(Yii::getLogger()->getMemoryUsage()/1024) . "KB)";

	?>

	console.group("<?php echo $pTitle; ?>");



Is there any reason this handy summary info is missing from firebug view? Would it be sensible to add this in as default to the yii core, if not, is there a way to override these view files with your own?

Save the file in protected/views/system. Should work.

/Tommy

Nope, didn’t work, for some reason yii is ignoring that file when i put it in my views.




views/system/profile-summary-firebug.php

Sorry, I was wrong. CErrorHandler::getViewFile() will look in that directory for error and exception views.

More specific:

CWebLogRoute::render() will use only the third path




$viewFile=YII_PATH.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$view.'.php';



/Tommy