Profiling on production


We’re getting some pretty major mileage on our development and staging servers out of being able to see SQL queries and profiling groups of calls. We can see all the places we’re accidentally loading from the DB multiple times, or extraneous calls to unneeded components. It’s great.

But where the performance really matters we can’t actually see the metrics, on the production server we;ve no idea how the request time is split up.

Two Questions:

  1. How much would this impact performance itself, by monitoring it? We only really care about the time taken for queries and profile blocks etc. rather than the stack traces and number of calls as this should be identical to development.

  2. How can we get the data out without displaying it on the page? I’ve tried other log routes but to no avail.

Thanks guys & gals

  1. Log routes, right. Especially CDbLogRoute and CFileLogRoute.

Don’t forget to adjust the ‘levels’ param.

Thanks for the tip, I can get the rows out that way but they’re only showing log times to the second.

I’ve hacked around it by extending the log route, changing the processLogs() function to not cast the log time to an integer, this then keeps the millisecond value. Still requires some post-processing.

I was hoping for something like an export of the profile summary you can get at the bottom of the page, with average time taken and whatnot.