If you're looking to detect slow database queries so that you know
where to target further profiling efforts, you should probably start
by looking Zend_Db_Profiler.  It will allow you to time each query and
optionally filter the results so you only display those that pass a
specified time threshold or are a specific type of query (e.g. SELECTs
only, not database connections themselves, etc.).  You can configure
the Zend_Db_Profiler to display inside Firebug for easy access during
development, write out to a log file, etc.

For actual page profiling I'd recommend using the profiling facilities
in Xdebug or Zend Profiler, but a simple timer could be build as a
Zend_Controller_Plugin where in the routeStartup() you set a parameter
to the value of microtime and then at the end of your layout, subtract
the value from routeStartup() from the current value of microtime().
That would get you a rough idea of page load times, but wouldn't be
completely accurate because it wouldn't include the very beginning of
the request.  That shouldn't be a problem, though, because that
portion of the request should be minimal and very consistent.

Hope that helps.

On Mon, Feb 15, 2010 at 11:09 PM, Ross Little <rosslit...@gmail.com> wrote:
>
> Hi Guys
>
> I'm developing a web app using the Zend Framework and want to be able to
> measure my page load times so that I can tweak my database queries and
> caching to maximum effect.
>
> Essentially, all I'm looking for is a string at the bottom of every page
> saying: page generated in xxxx
>
> Cheers guys
>
> Ross
> --
> View this message in context: 
> http://n4.nabble.com/Easy-way-to-page-generation-times-tp1556938p1556938.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to