From 08f6020b0085842d4ae81949a0f4886c94158a55 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 3 Oct 2006 05:28:00 +0000 Subject: --- user_guide/libraries/benchmark.html | 72 ++++++++++++---------------- user_guide/libraries/output.html | 15 ++++++ user_guide/libraries/profiler.html | 95 ------------------------------------- 3 files changed, 46 insertions(+), 136 deletions(-) delete mode 100644 user_guide/libraries/profiler.html (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index b8b0bfd32..8c1dc2c44 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -78,9 +78,9 @@ timing of the entire system execution to be shown.

@@ -98,15 +98,15 @@ timing of the entire system execution to be shown.

Here's an example using real code:

-$this->benchmark->mark('start');
+$this->benchmark->mark('code_start');

// Some code happens here

-$this->benchmark->mark('end');
+$this->benchmark->mark('code_end');

-echo $this->benchmark->elapsed_time('start', 'end');
+echo $this->benchmark->elapsed_time('code_start', 'code_end');
-

Note: The words "start" and "end" are arbitrary. They are simply words used to set two markers. You can +

Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can use any words you want, and you can set multiple sets of markers. Consider this example:

$this->benchmark->mark('dog');
@@ -124,6 +124,32 @@ echo $this->benchmark->elapsed_time('cat', 'bird');
echo $this->benchmark->elapsed_time('dog', 'bird');
+ +

Profiling Your Benchmark Points

+ +

If you want your benchmark data to be available to the +Profiler all of your marked points must be set up in pairs, and +each mark point name must end with _start and _end. +Each pair of points must otherwise be named identically. Example:

+ + +$this->benchmark->mark('my_mark_start');
+
+// Some code happens here...
+
+$this->benchmark->mark('my_mark_end'); +

+ +$this->benchmark->mark('another_mark_start');
+
+// Some more code happens here...
+
+$this->benchmark->mark('another_mark_end'); + +

Please read the Profiler page for more information.

+ + +

Displaying Total Execution Time

@@ -155,42 +181,6 @@ system using the following code in one of your view file:

{memory_usage} - -

Auto Profiler

- -

When the "auto profiler" is enabled, you'll see a report printed at the bottom of your pages containing a list of -execution times for all benchmarks you have set throughout your application. This information can help you optimize your program.

- -

Note: Even though this is a feature of the Benchmark class you will enable it from the Output class as indicated below.

- -

To enable the profiler place the the following function anywhere within your Controllers:

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

When enabled you'll see a table of execution times at the bottom of your pages.

- -

To disable the profiler you will use:

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

Important: In order to use this feature all of your marked points must end with _start and _end, and -each pair of points must otherwise be named identically. Example:

- - -$this->benchmark->mark('my_mark_start');
-
-// Some code happens here...
-
-$this->benchmark->mark('my_mark_end'); -

- -$this->benchmark->mark('another_mark_start');
-
-// Some more code happens here...
-
-$this->benchmark->mark('another_mark_end'); - -
- - diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index adc8fb58e..ad6a53d8f 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -105,6 +105,21 @@ $this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
output->set_header("Pragma: no-cache");
+

$this->output->enable_profiler();

+ +

Permits you to enable/disable the Profiler, which will display benchmark and other data +at the bottom of your pages for debugging and optimization purposes.

+ +

To enable the profiler place the 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); + + + diff --git a/user_guide/libraries/profiler.html b/user_guide/libraries/profiler.html deleted file mode 100644 index 2b162be0b..000000000 --- a/user_guide/libraries/profiler.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - -Code Igniter User Guide - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -

Code Igniter User Guide Version 1.5.0

-
- - - - - - - - - -
- - -
- - - -
- - - - -

Profiler Class

- -

The Profiler Class enables you to display benchmark, query, POST data at the bottom of your pages 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.

- - - -
- - - - - - - \ No newline at end of file -- cgit v1.2.3-24-g4f1b