CodeIgniter: measuring page load time

How to measure page load time in CI application using Smarty? Right now, I set breakpoints at the beginning and end of the index () method, but that only measures the execution time of the method, right? I want to know how long it will take to complete the page.

+4
source share
5 answers

I would point you to Codeigniter Profiler

When used in conjunction with benchmarking, it gives you fairly detailed results, this should be exactly what you are looking for.

make sure you adjust your breakpoints to fit the profiler specifications.

+6
source

Just paste in the html view:

{elapsed_time} like <p>Page rendered in {elapsed_time} seconds. 

When you have a new Codeigniter installation, just open the default welcome page. You can find this line in the footer.

+5
source

If you install xdebug , you can get this information much better than using the Codeigniter profiler. Better yet, use calgrind and read these magazines. I would advise you to take a look at these excellent PHP author slides. I even advise you to watch the video if some things are not clear from the slides .

The best way to test a complete request is to use the tool as a siege. He will bombard your page with queries to get a better picture of how it works under load.

0
source

if you use firefox, try the network firebug tab, it will show you how long it will load all the elements of the page, such information cannot be represented simply by a profiler

0
source

The Profiler class will display test results such as load times, queries, etc.
Enabling Profiler in Codeigniter

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

Watch the page footer when you see full information when you start the application.

Disable profiler

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

Source: https://habr.com/ru/post/1337067/


All Articles