From 8ede1a2ecbb62577afd32996956c5feaf7ddf9b6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 5 Oct 2011 13:34:52 -0500 Subject: replacing the old HTML user guide with a Sphinx-managed user guide --- user_guide_src/source/general/profiling.rst | 98 +++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 user_guide_src/source/general/profiling.rst (limited to 'user_guide_src/source/general/profiling.rst') diff --git a/user_guide_src/source/general/profiling.rst b/user_guide_src/source/general/profiling.rst new file mode 100644 index 000000000..60ef585ef --- /dev/null +++ b/user_guide_src/source/general/profiling.rst @@ -0,0 +1,98 @@ +########################## +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 :doc:`Output Class <../libraries/output>` if + profiling is enabled as shown below. + +Enabling the Profiler +===================== + +To enable the profiler place the following function anywhere within your +:doc:`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 :doc:`Benchmark +Class <../libraries/benchmark>` 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 :doc:`Output +class <../libraries/output>`:: + + $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. + +Key +Description +Default +**benchmarks** +Elapsed time of Benchmark points and total execution time +TRUE +**config** +CodeIgniter Config 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 -- cgit v1.2.3-24-g4f1b From a1360ef24fff8b57353db32ad6045969af28e5d5 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 5 Oct 2011 17:22:53 -0500 Subject: fixing code spacing in Profiling, Models, Managing Apps, Hooks, and Helpers general docs --- user_guide_src/source/general/profiling.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/general/profiling.rst') diff --git a/user_guide_src/source/general/profiling.rst b/user_guide_src/source/general/profiling.rst index 60ef585ef..28c1dd7b8 100644 --- a/user_guide_src/source/general/profiling.rst +++ b/user_guide_src/source/general/profiling.rst @@ -48,13 +48,19 @@ application/config/profiler.php config file. :: - $config['config']          = FALSE; $config['queries']         = FALSE; + $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 :doc:`Output class <../libraries/output>`:: - $sections = array(     'config'  => TRUE,     'queries' => TRUE     ); $this->output->set_profiler_sections($sections); + $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. -- cgit v1.2.3-24-g4f1b From 5b3ea1ac070882c09eb6cb93f2ca6628ec42d64d Mon Sep 17 00:00:00 2001 From: Joseph Wensley Date: Thu, 6 Oct 2011 20:54:32 -0400 Subject: change hardcoded page docs to use generated ones escape "http://" that was getting linked formatting some tables --- user_guide_src/source/general/profiling.rst | 53 +++++++++-------------------- 1 file changed, 16 insertions(+), 37 deletions(-) (limited to 'user_guide_src/source/general/profiling.rst') diff --git a/user_guide_src/source/general/profiling.rst b/user_guide_src/source/general/profiling.rst index 28c1dd7b8..437635289 100644 --- a/user_guide_src/source/general/profiling.rst +++ b/user_guide_src/source/general/profiling.rst @@ -65,40 +65,19 @@ class <../libraries/output>`:: Available sections and the array key used to access them are described in the table below. -Key -Description -Default -**benchmarks** -Elapsed time of Benchmark points and total execution time -TRUE -**config** -CodeIgniter Config 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 +======================= =================================================================== ======== +Key Description Default +======================= =================================================================== ======== +**benchmarks** Elapsed time of Benchmark points and total execution time TRUE +**config** CodeIgniter Config 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 25 + hidden. +======================= =================================================================== ======== \ No newline at end of file -- cgit v1.2.3-24-g4f1b