none
Measuring page load time and amount of data.

    Question

  • Hi,

    Can anyone give any ideas on how to measure the time it takes to load a page and the amount of data transferred?

    Any kind of ideas are welcome. What I want to do is:

    1. Clear IE cache (i already know how to do this.)

    2. Request IE to open a page

    3. Get indication when the operation is complete (all available files downloaded).

    4. Get to know the amount of data transferred ( and maybe number of files, etc..)

    I am planning to develop in C++. Can i somehow use WinInet to do this? I also should be able to view the page in IE.

    Thanks,

    - Janne_K

    Tuesday, February 06, 2007 9:26 AM

All replies

  • Hi Janne,

    I think the Fiddler tool can already provide you with those kinds of statistics. http://www.fiddlertool.com

    There are web sites that provide free speed tests for your page loads... Do a web search for 'web page load speed test'.

    www.websiteoptimization.com is one.

    Regards.

    Tuesday, February 06, 2007 12:12 PM
  • Thanks,

    I can't use Fiddler tool because it acts as a proxy :-(

    I Think there is some other way to do this but i have not been able to find any example code in MSDN or anywhere and I don't have the experience to just code it by myself. I cannot use any 'web page load speed test' -sites because the program I am developing is supposed to be run out of different locations and it is supposed to be running a continous test automatically.

    So far I have found out how to clear the IE cache, Open an instance of IE and command it to open an url. What I think I need now is to find out the HINTERNET handle of this instance so that i can monitor the data flow and http requests. I can already find out when the page is loaded in the IE window but I can't find the total amount of data transferred.




    Tuesday, February 06, 2007 1:56 PM
  • As the creator of Fiddler, I've looked at this problem pretty extensively.  There's no simple way to do what you're looking for natively, which is why Fiddler runs as a proxy.  You can use Detours or other tricks to get notified of all HTTP/HTTPS traffic, but this is non-trivial, non-supported, and somewhat likely to break in future versions of IE.

    Can you elaborate on why you cannot use Fiddler?  What exactly are you trying to accomplish?

    Wednesday, February 14, 2007 2:16 AM
  • Hi,

    Thanks for your reply.

    Can you tell me what kind of tricks or detours there are? It is enough if these tricks work with IE6 or IE7. It does not matter if these are hard to implement. It seems that I can use Fiddler if there are no alternative methods. What I have to do is:

    - Tell IE to open an address.
    - measure total amount of data and total time until the loading of page is completed.
    - It have to get this information in real time to be able to write it into a log file of my own format (with some other real time parameters)

    Is it possible to get indication of page load start/end and the amount of data transferred (and results, fail/success) from Fiddler in real time, with some callback functions or some other way from/to my own program. I think I can get the page load finished indication from IE, but the amount of data is the key problem now.

    EDIT: http://www.httpwatch.com
              http://www.httpanalyzer.com/
              These tools must then be using some of these tricks/detours, any idea how they work?

    Thanks,

    -Janne_K

    Tuesday, February 20, 2007 10:24 AM
  •  Janne_K wrote:
    Hi,

    Thanks for your reply.

    Can you tell me what kind of tricks or detours there are? It is enough if these tricks work with IE6 or IE7. It does not matter if these are hard to implement. It seems that I can use Fiddler if there are no alternative methods. What I have to do is:

    - Tell IE to open an address.
    - measure total amount of data and total time until the loading of page is completed.
    - It have to get this information in real time to be able to write it into a log file of my own format (with some other real time parameters)

    Is it possible to get indication of page load start/end and the amount of data transferred (and results, fail/success) from Fiddler in real time, with some callback functions or some other way from/to my own program. I think I can get the page load finished indication from IE, but the amount of data is the key problem now.

    EDIT: http://www.httpwatch.com
              http://www.httpanalyzer.com/
              These tools must then be using some of these tricks/detours, any idea how they work?

    Thanks,

    -Janne_K




    Still no progress, anyone wanna help me out?

    Monday, April 02, 2007 3:23 PM
  • Hi Janne_k

     

    Iam trying to get the page load complete from IE

    Can you help me how to achive that?

    Iam using VC 6.

    some saple code will be more usefull

     

    Thanks in advance

    - Selvaraj

    Thursday, May 10, 2007 6:29 AM
  • Hi,
    I'm looking exactly for the same thing..I'm trying to benchmark a web-application rendered on IE and I don't have any tools to measure the loadtime at the browser frontend.

    What I've got is firefox with addons (Fasterfox and Google Loadtime Analyzer) - these tools really work out for me, but I couldn't find anything similar for IE

    Help would be highly appreciated.

    Regards,

    DocB
    Thursday, January 17, 2008 4:10 PM
  • Hi,

    Even I am looking for this. I am trying to develop an application that would function like HttpWatch.

    Any idea about how to get each http request load time for a given web page?

    I am using a BHO to accomplish this.

    I dont know which interface or which event fired by IE can help me retrieve each individual http request.

    Please help --- Any type of suggestions would be appreciated.

     

    Thanks,

    Hiteshb

     

    Wednesday, February 06, 2008 8:45 AM

  • Load time: Initialialize a timer (time object) on the DISPID_BEFORENAVIGATE2 and stop it at DISPID_DOCUMENTCOMPLETE.
    this should work I guess.

    The data itself, can be tracked similarly through DISPID_DOWNLOADBEGIN and DISPID_DOWNLOADCOMPLETE.
    Thursday, February 21, 2008 1:58 PM
  •  

    Hi rollo tomasi,

     

    Thanks for your reply. I have already done that.

     

    But what I require is ----->  I want to capture time stamps for each & every Http request generated by Internet Explorer while fetching the web page. i.e.  while we fetch a particular web page ,say www.yahoo.com , the Internet Explorer generates multiple http requests for fetching all the objects that resides on the page. I need to capture these http requests and measure the time required for that http request.

     

    If you have any idea regarding this --- please do let me know.

     

    Tanking you & awaiting your reply.

    Hiteshb.

     

     

    Friday, February 22, 2008 12:40 PM
  • Ohh OK.

    VOID GetTime(CString cstrURL)
    {

    CComPtr<IUrlHistoryStg2> spHistory;
    HRESULT hr = CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC_SERVER,
                                       IID_IUrlHistoryStg2, reinterpret_cast<void **>(&spHistory));
        if (SUCCEEDED(hr))
        {
            STATURL bufferContainer;                       
            hr = spHistory->QueryUrl(cstrVisitedURL.GetBuffer(), STATURLFLAG_ISTOPLEVEL, &bufferContainer);
            if(SUCCEEDED(hr))
            { 
                FILETIME fileTime = bufferContainer.ftLastVisited;
                SYSTEMTIME systemTime;
                if(TRUE == FileTimeToSystemTime(&fileTime, &systemTime))
       {
    //filetime obtained.
       }
    }
         }
    }
    Friday, February 22, 2008 2:33 PM
  • Hi rollo tomasi,

    I got a problem when trying to measure amount of data transferred. You said that
    DISPID_DOWNLOADBEGIN and DISPID_DOWNLOADCOMPLETE could be used to measure it.

    But that 2 events don't have any parameter that could be used for measure data.

    I don't have any idea for this problem. Maybe some code could help me.

    Thanks for your reply
    Monday, September 15, 2008 5:38 AM
  • Hi Xavierite,

     

    The functioning of Internet Explorer is based on Events (Events Based Model).

    There are various events fired by Internet Explorer -- these events can be caught (we can listen to these events fired) and can take specific action on receiving the event notification.

     

    For Example --> When you navigate to a web page say, www.yahoo.com -- Initially BeforeNavigate event is fired.

    Then immediately after this navigation starts and DownloadBegin Event is fired to indicate that the browser has initiated downloading the page contents. Once done then -- DownloadComplete event is fired.

     

    Note : -- For every DownloadBegin Event , DownloadComplete event should be fired. Irrespective of whether download is sucesfull or not. DocumentComplete event is the one that is fired indicating that the document is successfully downloaded and ready to be used. So before accessing the document contents you need to verify that Doc is fully downloaded using the Documentcomplete Event

     

    Thus DownloadBegin & DownloadComplete are the events that would give you a notification when download has started and finished acccordingly. I dont think it would give you the amount of data that is transferred. What you can get is the timestamps of these events.

     

    Regards,

    Hiteshb.

    Monday, September 15, 2008 7:13 AM
  • strace and httreplay are the tools for the job.  they will absolutely and unequivocally answer your question.

    http://blogs.msdn.com/b/emmanubo/archive/2007/06/04/introduction-to-strace-httpreplay-support-tools.aspx


    • Edited by Brad-C Saturday, March 09, 2013 11:49 AM
    Saturday, March 09, 2013 11:47 AM