?
Solved

Best technique to test webpage load times in a console or service application

Posted on 2006-05-10
7
Medium Priority
?
266 Views
Last Modified: 2012-06-21
I've tried using the httpwebrequest/response but that will only give me a TTFB response time.  What are the best object, or techniques to use to measure page load times?
0
Comment
Question by:Nobletucky2004
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

by:mjmarlow
ID: 16662595
Is this for ASP.Net page?
0
 

Author Comment

by:Nobletucky2004
ID: 16662670
No, I'm running a windows services to try and monitor sites storing results in a Db.
0
 

Author Comment

by:Nobletucky2004
ID: 16662679
I tried running the WebBrowser class in the service (currently a console app) but I ran into threading errors.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Accepted Solution

by:
mjmarlow earned 2000 total points
ID: 16662836
How about something like this-

System.Net.WebClient client = new System.Net.WebClient();
DateTime start = DateTime.Now;
stream = client.OpenRead("http://www.experts-exchange.com");
sr = new System.IO.StreamReader(stream);
sr.ReadToEnd()
DateTime end = DateTime.Now
sr.Close();
stream.Close();


If you need higher resolution timer see:
http://www.eggheadcafe.com/articles/20021111.asp

0
 

Author Comment

by:Nobletucky2004
ID: 16662870
I agree that would give me the TTFB but it doesn't take into account all references files (i.e. Image, css, js, etc).  I currently have the same logic you posted, looking for a way to actually get a more accurate load time based on full page & Ref items loaded.
0
 
LVL 7

Expert Comment

by:mjmarlow
ID: 16662876
BTW - Actual browser page load time will vary based on HTML content and browser/ browser version used.  This is because different technologies parse and load the HTML/CSS/javascript etc.... differently.
0
 

Author Comment

by:Nobletucky2004
ID: 16663459
I totally agree with you, just looking for a relative load time by mimicing atleast one browser, namely IE v 5 or 6.  The only other approach I could think of was parsing the HTML for ref/link tags and making additional requests for the header information for the additional objects and just reading the byte size which I can than interpret at being a specific load time based on different connection speeds.  But if I had a way to mimic the total load of page like IE atleast I have some proof of time as opposed to completely derived values.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question