fabfuel / prophiler

PHP Profiler & Developer Toolbar (built for Phalcon)
http://prophiler.fabfuel.de
Other
443 stars 54 forks source link

Fantastic but I have issues #21

Closed al35mm closed 9 years ago

al35mm commented 9 years ago

I'm building an application that is built on mruz base-app version 1.3 (https://github.com/mruz/base-app/releases) with Phalcon 1.3.4.

I have tried Prophiler on a simple Phalcon app, and it seems to work fine, although I couldn't get anything displaying on time line.

The problem is on my app (based on mruz base-app) is that Prophiler results in really slow page loads. I have my app running on a vagrant box, and during page load, with Prophiler added, the CPU will some times max out. While the page displays ok, if I view the page source, it seems it is repeating or looping. The page source and HTML for prophiler is repeated over and over. Very strange, and unfortunately it makes Prophiler unusable for me on this project.

Any idea what the problem might be and how I can fix it?

al35mm commented 9 years ago

I have found I don't get the problem if I disable this line $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request()); in my front controller. So it's something to do with data collection.

fabfuel commented 9 years ago

Hi @al35mm!

Thanks for your feedback.

The Request data collector is basically just printing the contents of your $_GET, $_POST, $_COOKIE, $_FILES and $_SESSION superglobals. Does this happen when you send a big request with a lot of data/parameters? Or do you maybe have lots of data in your session? Otherwise I can not explain why this should cause performance issues.

Regarding the second issue: Prophiler uses the eventsManager service from the DI container to attach it's plugins. If you do not see anything on the timeline, please check that the services which should appear (dispatch, view and db by default) have the same EventsManager attached as well. You have to do that manually, otherwise Prophiler will not be notified about any events:

When you set up e.g. your dispatcher, please do something like that:

...
$dispatcher->setEventsManager($di->get('eventsManager'));
...

I hope that helps!

Best Fabian

hardlick commented 9 years ago

hi!, i try do this, but my timeline doesnt work!, help!

hardlick commented 9 years ago

has a example please?