Buggy is a PHP class that allows to store relevant informations while running a PHP script so it can be analysed to find bugs, or any problem in code execution.
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 :