Yii Framework Forum: [EXTENSION] PhpQuickProfiler - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] PhpQuickProfiler PhpQuickProfiler discussion forum Rate Topic: -----

#1 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 27 November 2011 - 01:12 PM

This is the Forum discussion for the PHP Quick Profiler extension

Please post any doubts here, and not in the extension page when possible.
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#2 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 27 November 2011 - 01:16 PM

webscriptz said:

unfortunately

It really is a nice piece of software but unfortunately i can't seem to get it to work properly, i've even copied it from the svn on google code and it still doesn't show anything...



Is it possible that you are not logging anything? try adding system.* to your categories, if you do not see anything after that then please paste your configuration so that I can help you further.
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#3 User is offline   lightglitch 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 05-January 10

Posted 30 November 2011 - 06:46 AM

Nice.

The memory log is something that could be added to the framework itself.
0

#4 User is offline   fsb 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 09-January 11

Posted 03 December 2011 - 08:16 PM

I'm seeing a rather odd problem.

Some of the log messages in the PhpQuickProfiler are missing parts of the text. For example, PQP reports the last like of one query as:
left join genre g2 on g2.id = dg2.genre_id group by u.id, dg2.is_primary LIMIT 50


while in protexted/runtime/application.log:
left join genre g2 on g2.id = dg2.genre_id where (c.user_id is not null) group by u.id, dg2.is_primary LIMIT 50


very odd.

do you have a regexp tidying up the strings for display that is perhaps being a bit too agressive?
Join the happiest place on Freenode: #yii
We've got a MrFisk the bot, hilarious banter and all kinds of other groovy stuff going on.
Comparison of Internet Relay Chat clients
Web IRC client
0

#5 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 03 December 2011 - 08:42 PM

View Postfsb, on 03 December 2011 - 08:16 PM, said:

I'm seeing a rather odd problem.

Some of the log messages in the PhpQuickProfiler are missing parts of the text. For example, PQP reports the last like of one query as:
left join genre g2 on g2.id = dg2.genre_id group by u.id, dg2.is_primary LIMIT 50


while in protexted/runtime/application.log:
left join genre g2 on g2.id = dg2.genre_id where (c.user_id is not null) group by u.id, dg2.is_primary LIMIT 50


very odd.

do you have a regexp tidying up the strings for display that is perhaps being a bit too agressive?


There are no regex, nor log processing, its very strange, are you entirely sure you are talking about the same query? can you isolate the query to be sure?
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#6 User is offline   Sebastian K. 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 62
  • Joined: 29-May 11

Posted 04 December 2011 - 05:52 AM

Very nice extension, thanks!
Is it possible to log page execution speed as described in following link, too?
http://particletree....quick-profiler/
0

#7 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 04 December 2011 - 08:08 PM

View PostSebastian K., on 04 December 2011 - 05:52 AM, said:

Very nice extension, thanks!
Is it possible to log page execution speed as described in following link, too?
http://particletree....quick-profiler/


Sure you can, and also in a better way than described, thats all thanks to Yii's profiling methods.

When they talk about object factory and object engine, you can just wrap the execution of those calls inside Yii::begindProfile/endProfile, to find out whats the execution time of calling exactly that code. which is a lot better than calculating the time difference by hand.

Also, as for the example, if you want to log code execution to a point in time, you can just call

 Yii::trace("Time taken to get to line ".__LINE__." ".Yii::getLogger()->getExecutionTime());


It will show in your console tab though. but I don't see the need when you can profile code blocks.
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#8 User is offline   coke 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 06-June 11

Posted 20 December 2011 - 02:55 AM

It looks awesome! I have a few questions and comments.

First of all, all queries are displayed in ms (milliseconds) but in fact they are in seconds.
Second, the"load time" and "memory used" tabs do not work for me. They both display "This panel has no log items". Did I miss any configuration?
Lastly, the profiler only appears if there is a database call. Some users might be confused and thought not working.
0

#9 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 20 December 2011 - 09:06 AM

View Postcoke, on 20 December 2011 - 02:55 AM, said:

It looks awesome! I have a few questions and comments.

First of all, all queries are displayed in ms (milliseconds) but in fact they are in seconds.
Second, the"load time" and "memory used" tabs do not work for me. They both display "This panel has no log items". Did I miss any configuration?
Lastly, the profiler only appears if there is a database call. Some users might be confused and thought not working.


thanks for you feedback, it is very much appreciated.

Ill take a look into the milliseconds thing.

As for your other questions:

  • Load time, most known as the Speed tab, only shows data if you have profiled anything within your application, using Yii::beginProfile() and Yii::endProfile()
  • The Memory Tab (memory used), only shows data if you have logged something using, PQPLogRoute::logMemory(),
  • The log may not show anything if nothing has been logged. you can log things using the aforementioned methods, and using Yii::trace and Yii::log, you can also add "system.*" to your categories in order to let the system trace framework information.

- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#10 User is offline   coke 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 06-June 11

Posted 20 December 2011 - 11:34 AM

Thanks Asgaroth, crystal clear!

This extension will definitely speed up the development! I am all for it.
0

#11 User is offline   coke 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 06-June 11

Posted 24 December 2011 - 11:24 AM

I got this strange error in unit testing after installing PhpQuickProfiler.
PHP Fatal error:  Uncaught exception 'CException' with message 'CAssetManager.basePath "/usr/bin/assets" is invalid. Please make sure the directory exists and is writable by the Web server process.' in /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php:112
Stack trace:
#0 /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php(97): CAssetManager->setBasePath('/usr/bin/assets')
#1 /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php(207): CAssetManager->getBasePath()
#2 /Applications/MAMP/htdocs/trackstar/protected/extensions/pqp/PQPLogRoute.php(48): CAssetManager->publish('/Applications/M...')
#3 /Applications/MAMP/htdocs/yiiPath/framework/logging/CLogRouter.php(65): PQPLogRoute->init()
#4 /Applications/MAMP/htdocs/yiiPath/framework/base/CModule.php(372): CLogRouter->init()
#5 /Applications/MAMP/htdocs/yiiPath/framework/base/CModule.php(477): CModule->getComponent('log')
#6 /Applications/MAMP/htdocs/yiiPath/framework/base/CApplication.php(142): CModule->preloadComponents()
#7 /Applications in /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php on line 112



If I comment out the installation in the main.php, the problem go away and unit test works fine. Any suggestions please?
/*
array(
     'class' => 'application.extensions.pqp.PQPLogRoute',
     'categories' => 'application.*, exception.*',
  ),
*/

0

#12 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 26 December 2011 - 09:21 AM

View Postcoke, on 24 December 2011 - 11:24 AM, said:

I got this strange error in unit testing after installing PhpQuickProfiler.
PHP Fatal error:  Uncaught exception 'CException' with message 'CAssetManager.basePath "/usr/bin/assets" is invalid. Please make sure the directory exists and is writable by the Web server process.' in /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php:112
Stack trace:
#0 /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php(97): CAssetManager->setBasePath('/usr/bin/assets')
#1 /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php(207): CAssetManager->getBasePath()
#2 /Applications/MAMP/htdocs/trackstar/protected/extensions/pqp/PQPLogRoute.php(48): CAssetManager->publish('/Applications/M...')
#3 /Applications/MAMP/htdocs/yiiPath/framework/logging/CLogRouter.php(65): PQPLogRoute->init()
#4 /Applications/MAMP/htdocs/yiiPath/framework/base/CModule.php(372): CLogRouter->init()
#5 /Applications/MAMP/htdocs/yiiPath/framework/base/CModule.php(477): CModule->getComponent('log')
#6 /Applications/MAMP/htdocs/yiiPath/framework/base/CApplication.php(142): CModule->preloadComponents()
#7 /Applications in /Applications/MAMP/htdocs/yiiPath/framework/web/CAssetManager.php on line 112



If I comment out the installation in the main.php, the problem go away and unit test works fine. Any suggestions please?
/*
array(
     'class' => 'application.extensions.pqp.PQPLogRoute',
     'categories' => 'application.*, exception.*',
  ),
*/



Sorry to be rude but RTFM there is a note about unit testing in the installation steps
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#13 User is offline   coke 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 06-June 11

Posted 26 December 2011 - 10:28 AM

View PostAsgaroth, on 26 December 2011 - 09:21 AM, said:

Sorry to be rude but RTFM there is a note about unit testing in the installation steps


Ha, my bad. I totally miss that part. It is a nice hack to isolate command line process. :D
0

#14 User is offline   EMAN 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 26-February 13

Posted 26 February 2013 - 01:50 AM

Hi, the PQP extension is really cool but I can't make it work integrating with my application's controllers. I followed the steps from http://www.yiiframew...pquickprofiler/ and it seems working when I access the PQPLogRoute class directly with my local url local.yii.com/PQPLogRoute. But when I insert logs (using Yii::trace, Yii::log, Yii::beginProfile and Yii::endProfile or PQPLogRoute::logMemory) in other controllers I can't see the logs. Where can I see the logs? Thanks. I hope there is a video demo for this exciting extension :)
0

#15 User is offline   EMAN 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 26-February 13

Posted 26 February 2013 - 02:50 AM

Oh yes! Figured it out, the $this->render('index'); line was not added to my controller's action that's why it didn't showed up.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users