Following on from my earlier question about storing logs for users, I now have a new conundrum to try and think of an answer to. In an application, I want to store efficiently all of the data that may be required in solving an issue, or working out performance issues with the application - say the loading time, MySQL queries per session etc. Obviously even with a few users doing this on each page is going to add milliseconds to the load time and overhead, the logs will get quite chocker (they would be gone after a week, e-mailing a report to myself and others) and is there a more sensible way of doing this, like an off the shelf application, or is there something clever built into PHP / MySQL that I am missing, or am I ok to add the one extra MySQL call per page load to add all of this information into the database?
I’ll leave it till a problem causes any issues then, cheers guys, and I’ve got the functions now for future reference. Will go away and read up on them anyway just so I know.
You could take a look at the xdebug extension, combined with cachegrind to analyse the output.
I’d strongly suggest you generally leave it disabled though, until you need it (i.e. to trace a reported problem) as logging this kind of stuff will eat a lot of disk space (as you already stated).
lol, logic_earth beat me to it
There is a much better way then having the application itself do its performance testing. Use xdebug and use its profiling features.