Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

How to time a individual web file request into its parts?

Looking to track and monitor time taken for web pages to download and identify bottlenecks.

After downloading the individual page html I can identify the files that are needed to make the request like the js, css and image files.

I want to be able to time how long each file takes and split into meaningful areas to identify any slow areas

The time areas for each file would be;

Blocking
DNS lookup
Connecting
Sending
Waiting
Receiving

How would I do that please?
0
stephenwilde
Asked:
stephenwilde
  • 6
  • 6
  • 2
  • +1
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
Using Firefox and Firebug, all that is shown on the Net tab.  Here's an example using one of my pages.
Firebug Net tab
0
 
stephenwildeAuthor Commented:
Thanks but I would like to have the data within .net c# so I can write the data to a database and manipulate the data before it is displayed.
0
 
Julian HansenCommented:
How are you going to do that though?
The data is recorded on the client side - you don't have access to that with .Net code.

The only solution is to have a browser plugin that collects that data and passes it back to your server for storage.
Will you be monitoring this from a browser you control or do you want to monitor this for all (random) visitors to the page?

Have you had a look at ShowSlow? I have not worked with it but it might do what you want

http://www.showslow.com/configure.php
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
stephenwildeAuthor Commented:
No looking to build a website audit programme

Mostly it deals with looking at content of title, h1 tags etc. for SEO purposes but would like to obtain data that runs automatically for each page of a several hundred page website, so needs automated code.
0
 
käµfm³d 👽Commented:
You could download each file via code, and time those downloads with one of the various timers found in the Framework, but this may or may not be an accurate representation of what a particular browser is doing. You have no way of knowing what a particular browser is doing before, during, and after a file is downloaded. I'm not trying to discourage you, but just keep in mind that there may be some discrepancy between your testing and a particular browser. (I suspect the timings will be mostly accurate.) Also, I doubt you'll be able to time the DNS lookup without doing some low-level TCP work. Again, if you're up for it, then by all means, but I don't think the normal classes we use to download from the web in .NET will give you timings on that.
0
 
Julian HansenCommented:
Data from such a process would be highly variable depending on a variety of factors - results you obtain may be totally different from another location.

Would a better solution be to rather look at the following per page

a) Total Page Size
b) Number of objects requested
c) In the case of scripted items - time for each script to complete.

These are more easily measurable and will give a better means to compare different pages / sites. Variances in line speed / server speed etc at time of test could skew results - whereas comparing actual objects and sizes will give a much better means of comparing.
0
 
stephenwildeAuthor Commented:
thank you, I agree with your observations

the issue is with

c) In the case of scripted items - time for each script to complete.

rather than just the "total time" for each item, I want to provide a breakdown to see if their is a bottleneck or problem with dns or server etc..
0
 
Julian HansenCommented:
bottleneck or problem with dns or server etc..

That can be done without having to access the page. These metrics are common for all page requests so I would implement that as a separate script that just times the DNS resolution and measure server latency. That can (and should be) done with a dedicated script so there is no variables in the equation that have nothing to do with the metrics being measured.
0
 
stephenwildeAuthor Commented:
thank you for your observations

looking for a direction on obtaining the script you describe
or classes, functions if any .net c# framework
or any 3rd party tool that can used ?
0
 
Julian HansenCommented:
For the DNS resolution - I would imagine put timing around a Dns.Resolve Dns.GetHostEntry - fairly straight forward.

For the server timing - a simple request to a hello world page with timing around the call would also give you server / network latency values.
0
 
stephenwildeAuthor Commented:
Thanks but any way to split the server time between, what DNS free testing provide namely;

Connecting
 Sending
 Waiting
 Receiving
0
 
Dave BaldwinFixer of ProblemsCommented:
@julian is right, the data can vary quite a bit.  I have two ISPs here, one connects at 10Mbps and the other at over 100Mbps.  That's a factor 10 difference on the download part alone.
0
 
Julian HansenCommented:
I am not sure what you are going to achieve by micro-managing the bits. There are so many variables in the mix - network speed, congestion, routing (number of hops), resource utilisation on DNS server etc etc etc - these will obscure any results you capture on the micro bits.

One has very little control over the DNS side of things - unless you have a bunch of very tech savy users who go around entering custom DNS settings instead of using the ISP served default - you are going to have very little control over the lookup process. Variables will differ on a minute to minute basis and from one location to the next.

I am sure there are many solutions to capturing the information you want but if this is for SEO purposes it might be a bit of overkill.
0
 
stephenwildeAuthor Commented:
Thanks all for there contributions on dealing with the issues
0
 
Julian HansenCommented:
You are welcome - thanks for the points.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 6
  • 6
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now