When constructing a web utility, we are very much concerned about the overall performance of the website in terms of how much time the controller took to execute and what kind of memory is used. Not only the overall performance, but we also need to see the insights of information like post data, facts of database queries, session data and many others. For restoring purpose while developing some application. CodeIgniter has made this task simpler for us by means of profiling and software.
To enable profiling of your application, simply execute the command given below in any of the method of your controller.
The report of the profiling can be seen at the bottom of the page after enabling it.
To disable profiling of your application, simply execute the command given below in any of the method of your controller.
Profiling can be performed by a section basis. you may enable or disable profiling of a segment by using setting a Boolean value true or false. in case you want to set profiling on the application then you can do a record located in software/config/profiler.php
as an example, the subsequent command will allow profiling queries for the whole application.
In the following table, the key is the parameter, which can be set in the config array to enable or disable a particular profile.
Key |
Description |
Default |
benchmarks |
Elapsed time of Benchmark points and total execution time |
TRUE |
config |
CodeIgniterConfig variables |
TRUE |
controller_info |
The Controller class and method requested |
TRUE |
get |
Any GET data passed in the request |
TRUE |
http_headers |
The HTTP headers for the current request |
TRUE |
memory_usage |
Amount of memory consumed by the current request, in bytes |
TRUE |
post |
Any POST data passed in the request |
TRUE |
queries |
Listing of all database queries executed, including execution time |
TRUE |
uri_string |
The URI of the current request |
TRUE |
session_data |
Data stored in the current session |
TRUE |
query_toggle_count |
The number of queries after which the query block will default to hidden. |
25 |
The profiler set in the file in application/config/profiler.php can be overridden by using the set_profiler_sections() function in controllers as shown below.
|
|
CodeIgniter Related Tutorials |
|
---|---|
PHP Tutorial | MySQL Tutorial |
Drupal Tutorial | WordPress Tutorial |
Joomla Tutorial | CakePHP Tutorial |
PHP7 Tutorial |
CodeIgniter Related Interview Questions |
|
---|---|
PHP Interview Questions | MySQL Interview Questions |
PHP+MySQL Interview Questions | Drupal Interview Questions |
MYSQL DBA Interview Questions | PHP5 Interview Questions |
WordPress Interview Questions | Joomla Interview Questions |
CakePHP Interview Questions | CodeIgniter Interview Questions |
PHP7 Interview Questions |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.