locked
How to count page load times for my web application? RRS feed

  • Question

  • User1685260560 posted

     Hi,

    I have developed a web application in vs2005 and I have deployed it on iis 6 (for testing purposes). 

    I would like to know if there is a way to get the time (statistical averege) that needed, from a page request till a complete page load. 

    Does vs2005 support this, do i have to write a script or something, are there any tools?

    My goal is to count the page load times for several pages of my application without using ssl and then compare it when using ssl for those pages...

     

    Please, any help would be welcome.

    Thanx in advance.
     

    Saturday, December 1, 2007 5:37 AM

All replies

  • User541108374 posted

    Hi,

    you could use Tracing. There are several settings available to have it outputted at the end of the page once rendered or to store it locally and later on retrieve that information through the /trace.axd HttpHandler.

    You can set it in different locations. The web.config or at the page level. There's also the possibility of health monitoring.

    Grz, Kris.

    Saturday, December 1, 2007 8:02 AM
  • User1685260560 posted

    Hi,

    Thank you for replying,

    I ve used Tracing and I admit i didnt expect it to be so detailed!

    I still am a bit comfused though...

    I am trying to find out the total time that needed for a client to view his page finished on his browser after making the request.

    When I view the details for the specific page on Trace.axd I go to Trace Information section and from there I look at the "from first" column.

    Since the documentation is not very detailed on this subject I assume that the the time i am looking for is the time written besides the end render message (time passed after the begin pre init message). 

    The problem is that those times cannot be acurate.

    I ve tried to request a 5MB(testing) page from a pentium 4 and from a pda with ssl enabled and the times in trace.axd where almost identical!


    0,132198924723673 for the pc, 0,134224321806263 for the pda. Obviously the real time it needed to see the page finished on my pda was around 5-10sec while on the pc was less than a second...

    Am I assuming something wrong?

    Does anyone knows any plugin for ie or any tool for iis that can inform me about the total loading time of pages?

    Thanx for the help 

     

    Monday, December 3, 2007 6:39 AM
  • User541108374 posted

    Ah ok, I interpreted your original question as the time needed to render your page. Tracing does that but only for the time spent on the server. If you want to include the time that's spent on the wire you could take the following approach:

    Create a page with a field that you fill up with the current time with javascript (do some googling for this) just before onsubmit. After postback and full rendering you could retrieve that value again and check with the current time in the onload event (javascript).

    Another one could be to use tools like Fiddler.

    Grz, Kris.

    Monday, December 3, 2007 7:21 AM
  • User1685260560 posted

     Thanx again Kris for replying!

    I followed your suggestions but unfortunately after spending more than half a day it didnt lead me anywhere...

    What I tried was:

    1)

    type: javascript state events

    code:

    dt=new Date();
    document.onreadystatechange=function() {
      if (document.readyState=="complete") {
        alert(((new Date() - dt)/1000));
      }
    }

    notes: gave extremely good results but it wouldnt run on IE Mobile or Firefox

     

    2)

    type of solution: asp.net page events

    notes: The last event that occurs on a page is supposed to be unload. The rendering is supposed to have finished by then! I put some code on the Page_Unload handler so that it writes the current time on a file. The file was already written way beffore the page was completed (the progress bar was not even half way through)!!!! Either I dont understand whats going on during the unload event or something is wrong...

     

    I ll start looking for profiling tools and keep you posted.

    Hope someone help me understand why the previous solutions didnt work, i am very curious.

    Thanx.
     

    Monday, December 3, 2007 6:58 PM