Jump to content

Recommended Posts

Posted

Perfmon Debug Toolbar is a Processwire module used in performance monitoring and optimization. This module has been kicking around for some time, but I finally got around to publishing it. The user interface is heavilly influenced by django-debug-toolbar if anyone is familiar with that project.

During install, $config->debug must be set to true for the toolbar to run, the module is not intended to be enabled on production.

The primary goal of the module is to identify bottlenecks and help tune up code.

More information is here:

https://github.com/KeeneState/DebugPerfmon

Please let me know if you have any difficulty installing or running it. It's intended to be run on a development instance, though it can exist in a dormant state in production.

Collapsed presentation (top right of screen):

post-477-0-35981400-1459541213_thumb.png

Expanded Presentation:

post-477-0-88977500-1459541213_thumb.png

  • Like 16
Posted

Hi Ben,

On PW 3.x I get this error. I haven't tested on 2.x

Fatal error: Access to undeclared static property: ProcessWire\Wire::$allLocalHooks in /Users/ajones/Sites/pwtest/site/assets/cache/FileCompiler/site/modules/DebugPerfmon/DebugPerfmon.module on line 122 Call Stack: 1.3810 30980112 1. DebugPerfmon->generate() /Users/ajones/Sites/pwtest/site/assets/cache/FileCompiler/site/modules/DebugPerfmon/DebugPerfmon.module:0

Posted

I decided to look into this. It's definitely related to PW 3 vs 2.

For 3.x you need this instead:

$hooks = array_merge(wire('pages')->getHooks('*'), wire('hooks')->getAllLocalHooks());

In Tracy I just used a conditional based on whether:

wire('config')->version

is >= 3

  • Like 5
Posted

Thanks Adrian, I'll get this update into the github repo this week--definitely a big plus to get 3.0 compatibility.

Update: fix is on github, and version revved to 1.0.1--somewhat off topic, but do any module developers know if module pages  (modules.processwire.com) pick up changes on github?

  • Like 1
Posted

Thanks Adrian, I'll get this update into the github repo this week--definitely a big plus to get 3.0 compatibility.

Update: fix is on github, and version revved to 1.0.1--somewhat off topic, but do any module developers know if module pages  (modules.processwire.com) pick up changes on github?

Thanks for the update.

Yes, the modules directory will update from Github once a day, but you can also manually update it by simply editing your module in the directory and saving.

  • Like 1
Posted

No problem.

One tiny thing I am noticing with your module. There is a quick FOUC when the page loads. Not a huge deal, but it would be nice if the details frame was hidden until the JS kicks in to collapse it.

Posted

I can take a look at that, for whatever reason I'm not seeing the flash, maybe a browser thing but I should be able to track it down. By "details frame," are you referring to the area with the blue heading covering the majority of the page, or the summary off to the right?

Posted

I am on Chrome/OSX

What I am seeing is content from the area with the blue heading. It isn't styled though - just a bunch of text at the bottom left of the page. It only happens when viewing the PW admin - not seeing it on the front-end at all.

Posted

Works great now - thanks!

Sorry, I have to take that back. A hard reload still results in the FOUC.

This however seems to work:

$(document).ready(function(){perfmon.elements.main.show()});
Posted

I took a conservative approach and added some stylesheet onload bookkeeping. I'm optimistic this will fix the flash of unstyled content once and for all.

  • Like 3
Posted

I took a conservative approach and added some stylesheet onload bookkeeping. I'm optimistic this will fix the flash of unstyled content once and for all.

Looks good to me - thanks again!

  • Like 1
  • 6 months later...
Posted

On PW 2.8.35 this error occurs:
Fatal error: Access to undeclared static property: Wire::$allLocalHooks in  ...  site/modules/DebugPerfmon/DebugPerfmon.module on line 126

$local_hooks = wire('config')->version >= 3 ? wire('hooks')->getAllLocalHooks() : Wire::$allLocalHooks;

which most likely results from the >= 3 and doesn't respect the 2.8 branch

I changed it to 2.8 which solves my current problem

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...