Load Monitor Beta - Be automatically notified of slow loading or high-memory pages that need optimizing

4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 28, 2015   (RSS)

By Dave - July 23, 2015 - edited: April 25, 2017

Hi All, 

UPDATE: I've updated the plugin attached to this thread to the latest version (v1.01).

Here's a little plugin I made to help us optimize sites.  Have you ever had one of the following: 

  • a client reporting that "some" pages are loading really slowly?
  • an "out of memory" error because a page or database query is using up too much memory?

This plugin warns you automatically about page that load slowly (on the server side) or use a lot of memory. It automatically makes an entry in the error log (and emails you if you have error log emails turned on).

The error messages look like this: 

So when you see that you can just look at the url listed and know that URL needs optimization.

And some Advanced features: 

You can adjust the warning threshold limits with these two lines in the plugin: 

$GLOBALS['LOADMONITOR_MAX_SECS'] = 2; // pages that take longer than this to load will be logged
$GLOBALS['LOADMONITOR_MAX_MEGS'] = 10; // pages that use more memory than this will be logged

And if you want some pages ignored you can set higher limits for them in the code by adding this to the top: 

// Load Monitor Plugin: Override/set logging limits
$GLOBALS['LOADMONITOR_MAX_SECS'] = 5; // pages that take longer than this to load will be logged
$GLOBALS['LOADMONITOR_MAX_MEGS'] = 10; // pages that use more memory than this will be logged

It you have a site that you want to check to see if it needs optimization, give it a try.  And let me know any feedback, thanks!

Dave Edis - Senior Developer
interactivetools.com
Attachments:

loadMonitor.php 5K

By Djulia - July 24, 2015 - edited: July 24, 2015

Hi Dave,

Thanks !!! :)

Is it possible to exclude a script (or a page)?

I have a script which downloads files on a remote server. The access time to the server is very often beyond the LOADMONITOR_MAX_SECS variable.
It is useless to check the execution time for this script.

That would be also interesting to ignore the scripts in cron jobs.

Thanks again!

Djulia

By Djulia - July 24, 2015

Dave>And if you want some pages ignored you can set higher limits for them in the code by adding this to the top:

Oops, in fact, I will use your recommendation.

I will observe average time for each script (also in cron) and will use it in the LOADMONITOR_MAX_SECS variable.

Thanks!

Djulia