I have a client whose desired Web UI is graphically intense; we would like to gather statistics on the average bandwidth of those connecting to the site. Is there an easy way to do that? The "simplest thing that could possibly work" would seem to be a Flash or Silverlight component that times the download of a file of some size (say 200K), then POSTing the result to a URI that saves the data. Will that work? Should I write my own or is there an easy drop-in element that I can download from somewhere?
I would look at Google Analytics. It's a simple javascript that you include on your page, and it uses Google's massive analytics databases to track who's accessing your site over what sort of connections, which is all in a database that they maintain.
You could certainly write a Flash or Silverlight (or javascript) component to download a file in the background, time it, and report that, but you're likely to anger your users for filling up their tubes.
There aren't too many tools that do this.
You might try BrowserHawk (http://www.cyscape.com/products/bhawk/features.aspx). See http://www.cyscape.com/showbrow.aspx?bhcp=1 and scroll down to connection details.
Probably the most effective way though, is to let the visitor decide. You can have a landing page with two big buttons that say "fast connection" and "slow connection" and let them click one.
Remember that if you do that, you will lose a certain number of visitors at that page, as they will be too lazy or disinterested to bother clicking. You may want to just go with the heavy version of the site and have a button in the nav somewhere that lets them switch back and forth.
It seems pretty easy to me.
- Take your webserver logs and scan for your index page and all images linked from that index page.
- Get the difference between the last image complete timestamp and the index complete timestamp.
- Total up the size of all images that were fully loaded (not cached if-modified-since 304s).
- Divide that total by the time difference.
You should have effective bytes per second for that user.
The Apache webserver can log how long a request takes (in seconds); combine this with something like mod_logio to tell you how much data you're actually sending to the client and determine KB/sec.
http://httpd.apache.org/docs/2.0/mod/mod_logio.html
http://httpd.apache.org/docs/2.0/mod/mod_log_config.html -- look for '%...T'