I got an app which has a few slow pages, so I am trying to create some basic figure sof where the app is currently at.
Using curl and just recording the response to a table seems like the way to go.
Using this; http://php.net/manual/en/function.curl-getinfo.php
I figured i could use “CURLINFO_STARTTRANSFER_TIME” which should tell me, about the time it’s taken the app to generate this response, and this wont include the time to look up the name server, or do the handshake or anything.
However, I notice that this value is high, even on a txt page.
I ideally I could edit the PHP of the app, and put start/end times in it, but I can’t.
Will using CURLINFO_STARTTRANSFER_TIME be a semi accurate way of determining how long it took the app to build the request (excluding network overhead)?
Any other suggestions.
This question is like, “how can I use a square peg to fit a round hole”. I’m just trying to use that statement to explain that you are approaching your problem in the wrong way.
If you want to do this the correct way, you should install a proper profiler, something like xdebug, and then start profiling your requests. Given any particular profiled page, you get accurate (at least as accurate as they can be in a profiled environment) timings based on how long different parts of your application actually take to process.
There is no substitution for benching your application than using a proper profiler. Using curl will only tell you how long it took for a request to be performed. In which case you may as well just open up firebug and see how long it takes to load.
(I know this doesn’t answer your question but since StackOverflow is a wiki, I feel it will help someone else).