|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2023-02-28 (26 days ago) || 68%||Total: 249 This week: 1||All time: 7,903 This week: 154|
This class can log time and resources used during PHP script execution until they exit without having to change the actual script code.
It appends to a log file the time a script took execute since the class was loaded, as well the maximum usage of RAM, the URL of current request and the request parameters.
The log files will be stored separated by days in a different directory per virtual host.
Configuring PHP to run the class before the script starts using the php_value auto_prepend_file configuration value and calling it for the last time from the PHP shutdown function, the class can measure the time and resource usage since the beginning until the end of execution of the script.
The class can also be started in the beginning of regular PHP scripts without requiring changes to PHP configuration values.
Prize: One downloadable copy of CodeLobster Professional
|Many benchmark scripts can measure the time it takes to execute portions of a given script.
This class implements an approach that can measure the time a script takes to execute a a whole, right before it starts using the auto_prepend_file setting, until it ends using the register_shutdown_function function.
Benchmark trace & log any php, without modifying a single line of code. Usefull to trace access, monitoring run times & ram and debugging params (get / post / argv).
Copy XBenchmark.php anywhere on your system.
Works either in Windows & Linux
Method 1 (For any PHP)
Modify your php.ini:
auto_prepend_file = /absolute/path/to/XBenchmark.php
Method 2 (For a virtual host)
Modify the .htaccess file under your DOCUMENT_ROOT dir, add:
php_value auto_prepend_file /absolute/path/to/XBenchmark.php
Method 3 (For only one PHP)
Modify your PHP file, put on top:
In any case, verify that you have permissions on the XBENCHMARK_LOGS_DIR specified, and assign correct path to the XBenchmark.php file
After apache restart (only in "Method 1" needed),
Go to any website under your apache envieronment.
You will have all logs saved under XBENCHMARK_LOGS_DIR/HOST.
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.