CodeIgniter Forums
Profiling Db queries and page load time in a database table - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Profiling Db queries and page load time in a database table (/showthread.php?tid=80138)



Profiling Db queries and page load time in a database table - Fariv - 09-17-2021

Hi Everyone,

I am new in the Forum and trying out CI4.
While migrating a CI3 projects to CI4, I am stuck at a point.

I want to get all the queries and number of queries from first page load to last, and save it in a table. Obviously, the table will be huge but it was implemented in CI3 by modfying system file.
But now, I do not want to edit the system file of CI4 anymore for this feature.

Can anyone guide me how do I establish the feature for the project in CI4 to save all queries, number of queries (if all queries can be attained, then count of it can also be attained) and the time to load the whole page.

I have gotten an idea to use the Events but I am not totally understood how the process could be done.
An action of flows to how I can implement this wold be appreciated much.


RE: Profiling Db queries and page load time in a database table - InsiteFX - 09-18-2021

You can take a look at these tutorials and see if they will help you out.

CodeIgniter 4 Complete Events Tutorial

Complete CodeIgniter 4 Model Events Tutorial

Good luck.