X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=user_guide%2Fgeneral%2Fprofiling.html;fp=user_guide%2Fgeneral%2Fprofiling.html;h=f3ea0c6fd244c14e7deb06ad5bb283332508b00a;hb=6d8f5b56b237767344bc4a283b4093e6d6f1a612;hp=0000000000000000000000000000000000000000;hpb=0f67329ebdddeb59a2b6b79aedb1fce421378ca8;p=living-lab-site.git diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html new file mode 100755 index 0000000..f3ea0c6 --- /dev/null +++ b/user_guide/general/profiling.html @@ -0,0 +1,176 @@ + + + + + +Profiling Your Application : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

CodeIgniter User Guide Version 2.0.2

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Profiling Your Application

+ +

The Profiler Class will display benchmark results, queries you have run, and $_POST data at the bottom of your pages. +This information can be useful during development in order to help with debugging and optimization.

+ + +

Initializing the Class

+ +

Important:  This class does NOT need to be initialized. It is loaded automatically by the +Output Class if profiling is enabled as shown below.

+ +

Enabling the Profiler

+ +

To enable the profiler place the following function anywhere within your Controller functions:

+ $this->output->enable_profiler(TRUE); + +

When enabled a report will be generated and inserted at the bottom of your pages.

+ +

To disable the profiler you will use:

+ $this->output->enable_profiler(FALSE); + + +

Setting Benchmark Points

+ +

In order for the Profiler to compile and display your benchmark data you must name your mark points using specific syntax.

+ +

Please read the information on setting Benchmark points in Benchmark Class page.

+ + +

Enabling and Disabling Profiler Sections

+ +

Each section of Profiler data can be enabled or disabled by setting a corresponding config variable to TRUE or FALSE. This can be done one of two ways. First, you can set application wide defaults with the application/config/profiler.php config file.

+ + $config['config']          = FALSE;
+ $config['queries']         = FALSE;
+ +

In your controllers, you can override the defaults and config file values by calling the set_profiler_sections() method of the Output class:

+ + $sections = array(
+     'config'  => TRUE,
+     'queries' => TRUE
+     );
+
+ $this->output->set_profiler_sections($sections);
+ +

Available sections and the array key used to access them are described in the table below.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDescriptionDefault
benchmarksElapsed time of Benchmark points and total execution timeTRUE
configCodeIgniter Config variablesTRUE
controller_infoThe Controller class and method requestedTRUE
getAny GET data passed in the requestTRUE
http_headersThe HTTP headers for the current requestTRUE
memory_usageAmount of memory consumed by the current request, in bytesTRUE
postAny POST data passed in the requestTRUE
queriesListing of all database queries executed, including execution timeTRUE
uri_stringThe URI of the current requestTRUE
+ + +
+ + + + + + + \ No newline at end of file