views:

358

answers:

5

I work on an internal corporate system that has a web front-end as one of its interfaces.

The web front-end is served up using Tomcat.

How can I monitor the rendering time of specific pages in a browser (IE6)?

I would like to be able to record the results in a log file (separate log file or the Tomcat access log).

EDIT: Ideally, I need to monitor the rendering on the clients accessing the pages.

A: 

As far as non-invasive techniques are concerned, Hammerhead measures complete load time (including JavaScript execution), albeit in Firefox only.

I've seen usable results when a JavaScript snippet could be added globally to measure the start and end of each page load operation.

Tomislav Nakic-Alfirevic
A: 

Have a look at Selenium - they offer a remote control that can automatically start different browsers (e.g. IE6), load pages, test for specific content on the page. At the end reports are generated that also show the rendering times.

pitpod
+1  A: 

In case a browser has JavaScript enabled one of the things you could do is to write an inline script and send it first thing in your HTML. The script would do two things:

  1. Record current system time in a JS variable (if you're lucky the time could roughly correspond to the page rendering start time).
  2. Attach JS function to the page onLoad event. This function will then query the current system time once again, subtract the start time from step 1 and send it to the server along with the page location (or some unique ID you could insert into the inline script dynamically on your server).

var renderStart = new Date().getTime();
window.onload=function() { 
   var elapsed = new Date().getTime()-renderStart;
   // send the info to the server 
   alert('Rendered in ' + elapsed + 'ms'); 
} 


... usual HTML starts here ...

You'd need to make sure that the page doesn’t override onload later in the code, but adds to the event handlers list instead.

Totophil
+1 - This sounds like the kind of thing that I currently have in mind. Good to get confirmation of that line of thinking. Anybody think this is the wrong approach?
adpd
A: 

Since others are posting answers that use other browsers, I guess I will too. Chrome has a very detailed profiling system that breaks down the rendering time of the page and shows the time it took for each step along the way.

As for IE, you might want to consider writing a plugin. There seems to be few tools like this on the market. Maybe you could sell it.

George Edison
I agree with the (too) "few tools" on the market for IE. Writing a plug-in might not be a bad idea. I may take a look at that one.Thanks for the suggestion on Chrome, but the client machines have to run IE6 for the time-being as that is corporate IT policy. When an upgrade comes round, it will be IE7 or IE8 for sure.If only I had the luxury of other browsers...
adpd
A: 

On Firefox you can use Firebug to monitor load time. With the YSlow plugin you can even get recommendations how to improve the performance.

Zoltan