DooPHP IRC channel


DooLog showProfiles()

Discussion about weird behaviors of DooPHP.

DooLog showProfiles()

Postby donkapone » Sat Jun 18, 2011 7:37 pm

When calling showProfiles() i'm getting
Code: Select all
Undefined index: result
See file C:\wamp\www\doophp\dooframework\logging\DooLog.php
Error on line 337 $msg .= $this->formatProfileXML($k,$p[2],$p[3], $p['result'], $p['memory']);


The problem arises when calling showProfiles() function before endDbProfile() is called. Now it returns a Notice when error_reporting is set to E_STRICT and returns nothing when it's not. Since only when endDbProfile() is called the time spent (result index) and the memory is written:

Code: Select all
$this->_profiles[$token]['result'] = microtime(true) - $this->_profiles[$token][3];
$this->_profiles[$token]['memory'] = $this->memory_used() - $this->_profiles[$token]['startmem'];


Suggested fix would be to see if result and memory indexes aren't set - set them with previous code. That way the showProfiles() would return how much time and memory was spent until it was called. Any other ideas?
donkapone
 
Posts: 27
Joined: Fri Jun 17, 2011 4:46 pm

Re: DooLog showProfiles()

Postby leng » Mon Jun 20, 2011 5:27 am

To use profiling tools in the framework, you have to follow this workflow:
Code: Select all
beginProfile()
endProfile()
showProfiles()

You cannot called showProfiles before a profile block is complete/ended. In case you didn't notice, there's another showDbProfiles() dedicated for DB profiled results.
Just Doo IT!
leng
 
Posts: 1482
Joined: Thu Jul 16, 2009 11:33 pm


Return to Bugs Report

Who is online

Users browsing this forum: No registered users and 0 guests