Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb PHP Emulate Broswer Requests Time. Request Website Page Speed / Load Times.

    Hi,
    Im currently building a script to monitor / check on my sites and report back to me with their availability, HTTP Status Codes, and importantly here, the PAGE LOAD TIME.

    Im currently doing this with curl requests, and this works for getting status's, and finding out many other things about the pages / sites. BUT it will only give me the time it took to grab the html on the page.

    Is there a way to set it to download more sort of like a browser would. So it would record the total time in which it takes a user to download the html, css, JavaScript, images etc.

    I have thought about just using the CURL script to download the html originally, and using the multiple settings (curl_multi_*) to download each of the components to make up the page, but this seems long winded.
    I wondered if there was a better way than using curl, or maybe a pre-built set of classes ready for this but i have searched google and no such luck.

    I know of some online tools that request pages sort of how i want to, e.g. http://tools.pingdom.com/, and http://loadimpact.com/pageanalyzer.php but i don't need all the info they generate, just the end result page load time that the user would experience.

    Not sure if this is possible in PHP, may need to switch to python or another language to do this part of the script.
    If anyone else has used/built a script capable of this please let me know!

    I have posted this on a couple of other forums now but no luck on them, hope to hear any tips or anything on here.

    Cheers!

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Also be sure to take into account that your server is (hopefully) housed within a network center utilizing a much faster dedicated connection than the majority of internet users.

    It might take your server half a second to grab all the files on your site, but it may my DSL connection 2-3 seconds or so.
    Last edited by kbluhm; 07-01-2010 at 06:05 PM.

  • #3
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by kbluhm View Post
    Also be sure to take into account that your server is (hopefully) housed within a network center utilizing a much faster dedicated connection than the majority of internet users.

    It might take your server half a second to grab all the files on your site, but it may my DSL connection 2-3 seconds or so.
    kbluhm, i do hope to eventually be able to get the script to measure load times across different speeds, and maybe across multiple browsers.
    Need to crack the original getting the data first though, because a rough estimate of a load time would give me something to base scores upon, so if the sites slow down, i can still notice that even though its still running much faster than i would actually experience it.

  • #4
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any Ideas Anyone?

    Just been looking at using COM, but i would need to invest in using a windows server.
    Found an article on using the COM class to screen grab sites so i assume you could use it aswell to time the load of pages.
    using... $browser = new COM("Internet Explorer.Application"); etc...
    Not sure if i can test this on my windows PC though, i have XAMPP, but when i run the script i get errors, i assume i need to install some things. Has anyone here used the COM class, give me any advise with it, maybe anyone using .NET have any ideas i could migrate to PHP, or use PHP to execute a .NET or even C program in order to get the result time?

    Anything ?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •