|
|
|
Buggy uses its own database abstraction that you can change to allow store all queries used in the system in database.
First you should include db2.class.php and buggy.class.php
then initialize the Buggy object :
// 3 for Debug level - 0 production system
Buggy::_init(3);
Then start the Buggy system in the beginning of the code :
Buggy::StartScript();
This will log the event "Begin script execution" in the database and start a timer wich will give the total time execution of the script.
Then put this before last code executed in script
Buggy::EndScript();
This will store the time used by the buggy's queries and the "End of script execution" event in database.
To log any other event in your code you can use for example :
Buggy::logMessage('AbstractDB', 'Begin', $query);
Buggy::SetMicroTime('AbstractDB');
Where AbstractDB is the module, "Begin" is the event and $query the current executed query for example. then we can set a timer named "AbstractDB". After running the query we can get the time used with GetExecutionTime() and log the Event "End" for the AbstractDB module :
$time = Buggy::GetExecutionTime('AbstractDB');
Buggy::logMessage('AbstractDB', 'End', "Query done",$time);
Buggy log also all PHP errors in database.
You can read from the buggy table in database or just create a small web tool to create reports from it.
Any question or comment are welcomed.
Hatem
http://phptunisie.net |
|
| The class to check load time of your script
VERY usefull for relatively slow applications, but not only.. Categories : PHP, PHP Classes, Debugging | | | A Custom Error Handling And Debugging Class Categories : PHP, PHP Classes, Debugging, Errors and Logging | | | A time measuring and performance benchmarking class Categories : PHP, PHP Classes, Testing, Debugging, Date Time | | | [PHP5] PHP Debugger and Helper Categories : PHP, PHP Classes, Errors and Logging, Debugging, XML | | | Password reminder Categories : PHP, PHP Classes, Databases, MySQL, Mail | | | Form Elements Class Categories : PHP, PHP Classes, Form Processing | | | Filter - A simple class that lets you use multiple functions to create custom filters. Categories : PHP, PHP Classes, Strings | | | DbObject - A PHP wrapper for working with various databases Categories : Databases, PHP, PHP Classes | | | Simple class that uses GD to draw pie charts. After the class definition there's some sample code to demonstrate how you use the class.
Categories : Graphics, PHP, PHP Classes, GD image library, Charts and Graphs | | | Browser Detecor Class Categories : PHP Classes, PHP, HTML | | | Bs_IniHandler is a class that can read and write ini-style files (and strings) Categories : PHP, Filesystem, PHP Classes | | | Specify your connection settings and create a link to a MySQL database. Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides | | | PHP Zip Utility Categories : PHP, PHP Classes, Compression | | | Example of function to send out email if error occurs Categories : PHP, Email, Debugging, Errors and Logging | | | Customizable Calendar Class Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar | |
|
|