- CodeIgniter - Security
- CodeIgniter - Internationalization
- CodeIgniter - Adding JS and CSS
- CodeIgniter - Benchmarking
- CodeIgniter - Application Profiling
- CodeIgniter - Page Redirection
- CodeIgniter - Page Caching
- CodeIgniter - Common Functions
- CodeIgniter - Cookie Management
- CodeIgniter - Tempdata
- CodeIgniter - Flashdata
- CodeIgniter - Session Management
- CodeIgniter - Form Validation
- CodeIgniter - Sending Email
- CodeIgniter - File Uploading
- CodeIgniter - Error Handling
- CodeIgniter - Libraries
- CodeIgniter - Working with Database
- CodeIgniter - Configuration
- CodeIgniter - Basic Concepts
- CodeIgniter - MVC Framework
- CodeIgniter - Application Architecture
- CodeIgniter - Installing CodeIgniter
- CodeIgniter - Overview
- CodeIgniter - Home
CodeIgniter Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
CodeIgniter - Apppcation Profipng
When building a web apppcation, we are very much concerned about the performance of the website in terms of how much time the controller took to execute and how much memory is used. Not only the performance, but we also need to see the insights of data pke POST data, data of database queries, session data etc. for debugging purpose while developing some apppcation. CodeIgniter has made this job easier for us by profipng an apppcation.
Enable Profipng
To enable profipng of your apppcation, simply execute the command given below in any of the method of your controller.
$this->output->enable_profiler(TRUE);
The report of the profipng can be seen at the bottom of the page after enabpng it.
Disable Profipng
To disable profipng of your apppcation, simply execute the command given below in any of the method of your controller.
$this->output->enable_profiler(FALSE);
Enable / Disable Profiler Section
Profipng can be done on section basis. You can enable or disable profipng of a section by setting a Boolean value TRUE or FALSE. If you want to set profipng on the apppcation then you can do in a file located in apppcation/config/profiler.php
For example, the following command will enable profipng queries for the whole apppcation.
$config[ queries ] = TRUE;
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 apppcation/config/profiler.php can be overridden by using the set_profiler_sections() function in controllers as shown below.
$sections = array( config => TRUE, queries => TRUE ); $this->output->set_profiler_sections($sections);Advertisements