[New] Plugin speedMon_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
manu
Posts: 683
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

[New] Plugin speedMon_XH

Post by manu » Mon Sep 22, 2014 12:59 pm

This plugin allows you to measure the servertime of your plugin/script sequence whatsoever:

Code: Select all

speedMon('mySample');  //1st call = sequence Start of "mySample"
....
speedMon('mySample');  //2nd call = measure elapsed time of "mySample"
...
speedMon('myOtherSample');  //3nd call = sequence Start of "mySample"
...
speedMon('myOtherSample');  //4nd call = measure elapsed time of "myOtherSample"
...
echo speedMon();  //call at the end of template: outputs the elapsed time of your samples
It's alpha state: Even the code is quite functional, there is no help file, no config file, no localization.
I'm waiting for comments, request etc.
Download
regards & have fun
manu

cmb
Posts: 12877
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [New] Plugin speedMon_XH

Post by cmb » Mon Sep 22, 2014 2:53 pm

Currently the download doesn't work; the redirect to the protected download form does not happen. :?

I tried downloading via http://so-leicht.ch/?filedownload&filex ... alpha1.zip, but the email didn't contain an attachement.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

manu
Posts: 683
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: [New] Plugin speedMon_XH

Post by manu » Mon Sep 22, 2014 6:21 pm

cmb wrote:Currently the download doesn't work; the redirect to the protected download form does not happen. :?

I tried downloading via http://so-leicht.ch/?filedownload&filex ... alpha1.zip, but the email didn't contain an attachement.
Ooops, typo.
Please retry.

cmb
Posts: 12877
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [New] Plugin speedMon_XH

Post by cmb » Mon Sep 22, 2014 7:43 pm

manu wrote:Please retry.
The download works fine now.

The plugin is quite interesting. Occasionally, I did some measurements on my website, where I don't have any real profiling capability, and for such cases speedmon() comes in handy. For now I tested it only locally (Win7), and there microtime() is barely usable (see https://bugs.php.net/bug.php?id=64633).

One case where speedmon() might be interesting is measuring the performance of a plugin function when called from the contents. One could do:

Code: Select all

{{{speedmon('plugin');}}}
{{{plugin_call();}}}
{{{speedmon('plugin');}}}
However, the multiple plugin calls might distort the results significantly. It might be nice to have the following shortcut available:

Code: Select all

{{{speedmon(function () {plugin_call();});}}}
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

manu
Posts: 683
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: [New] Plugin speedMon_XH

Post by manu » Fri Oct 24, 2014 9:12 am

speedMon_XH1alpha2 is available, running on PHP5.3 and above:

Code: Select all

speedMon('mySample');  //1st call = sequence Start of "mySample"
....
speedMon('mySample');  //2nd call = measure elapsed time of "mySample"
...
speedMon('myOtherSample');  //3nd call = sequence Start of "mySample"
...
speedMon('myOtherSample');  //4nd call = measure elapsed time of "myOtherSample"
...
echo speedMon();  //call at the end of template: outputs the elapsed time of your samples
... 
NEW
speedMon('Fn',function(){my_plugin_function();}); //measure encapsulated plugin function() & store value in array
...
speedMon(NULL,function(){my_plugin_function();}); //measure encapsulated plugin function & return value directly
cmb wrote:For now I tested it only locally (Win7), and there microtime() is barely usable (see https://bugs.php.net/bug.php?id=64633).
At least you have an accuracy of 16msecs thats still not too bad for seeking server demanding plugins.
cmb wrote:It might be nice to have the following shortcut available:

Code: Select all

{{{speedmon(function () {plugin_call();});}}}
This is now possible, see above.
regards
manu

Post Reply