A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Test this bandwidth tester Please.. need feedback.

  1. #1
    Senior Member
    Join Date
    Nov 2003
    Posts
    524

    Test this bandwidth tester Please.. need feedback.

    Hi,
    I am testing a method of obtaining an aproximation of a site visitors bandwidth (or at least the speed they are loading my files at).

    The following link is where I am testing.
    http://www.ozwide.net.au/~mpelic/shi...bandWidth.html
    So far I seem to have had success. With a file size of only 11Kb the return data matches within a usable margin my connection speed.

    Please have a go at it and post back your results (letting me know your bandwidth) as I would like a more complete picture of the accuracy or inaccuracy of the script I am using.

    Thanks in advance. I will post the script if anyone is interested.

    Shipstern

  2. #2
    Happy FK'er TheWaste's Avatar
    Join Date
    Dec 2003
    Location
    Here
    Posts
    779
    I got 50kbps.
    Pretty close to what I shoulda got.
    I have cable but live in australia. I assume you live in the US so thats probably the speed I woulda achieved for such a small file without my bandwidth reaching peak speed.
    good work. that code might be very helpful --

    edit: my bad. your aussie too :P
    oh well. i still believe my peak speed argument. being it a bigger file it woulda given my comp a chance to get a better speed.
    "Good lord, you're wasting thousands of dollars worth of Interferon!"
    "... and you're Interferon with our good time!"

  3. #3
    Senior Member
    Join Date
    Nov 2003
    Posts
    524
    Hi TheWaste,

    Your the first to reply. Thanks heaps.
    I am in Aus. too. but on a dial up connection.
    I had considered a larger file but I really wanted to see how accurate it could be with a small file. This way by testing on a small
    file loaded with loadMovie() at the opening of the site I can then load content suitable for the users download speed. Or at least prompt them that they may wish to make that choice.
    This makes it more possible to deliver a site heavy on animation/sound or a lighter version. I hate developing sites based solely around the lowest common denominator when there is so much to offer those who can handle it.

    Thanks again.

    Shipstern.

  4. #4
    Member
    Join Date
    Dec 2003
    Posts
    58
    Hi there,

    very nice idea! Please, post your code!

    my results:

    37784 bps
    50176 bps
    42236 bps

    I made some more tests, just now. You're results look pretty good!

    http://www.beelinebandwidthtest.com/

    114 K/s, 912 Kbps
    111 K/s, 888 Kbps

    http://www.desk.nl/~dfm/tech/test/speed/big.htm

    98880 cps
    102230 cps

    (the previous two sites are hosted in nl, which is where I am)

    http://www.activeenzymes.com.au/bandwidth/

    447.9 kbps
    622 kbps
    457.9 kbps

    http://www.alphaville.com.au/bandwid...itialmeter.php

    560.1 kbps
    545.3 kbps

    http://users.bigpond.net.au/vk4go/speed.htm

    586.4 kbits/sec
    580.17 kbits/sec

  5. #5
    Senior Member
    Join Date
    Nov 2003
    Posts
    524
    Hi pecoes,

    Fantastic!!!!!
    That is a heap of output and much appretiated. I have attached the .fla file. I commented it a bit so you get some idea of whats what.
    It is just two frames the first collecting the data with the use of setInterval() and the function lc(). The setInterval() is set really fast and I think that Flash most probably can't really deliver this speed (but it will try).
    The second frame just calculates the collected data and puts it into the text fields.
    The script is not optimized in any way and I know it could be improved on so any ideas are welcome. I used getTimer() to establish the time lapsed there may be a better method .. but I don't know what.

    I use FlashMX(not 2004) on Windows PC. So I have also included the script below for anyone who may be developing on a different platform.

    Frame 1:
    Code:
    stop();
    //get the date time to append to URL to allow multiple tests without 
    //clearing the browser cache
    myDate= new Date();
    Y=myDate.getFullYear();
    M=myDate.getMonth();
    D=myDate.getDate();
    mill=myDate.getMilliseconds();
    
    //variables for holding time lapsed
    //Time At Load Initiation
    TALI=undefined;
    //Time At First Data recieved
    TAFD=undefined;
    //Time At Fully Loaded
    TAFL=undefined;
    //flag variable for getting initial byte read
    flag=0;
    //create the holder clip
    this.createEmptyMovieClip("h",0);
    //initiate the .swf load
    h.loadMovie("globalAssets/swfs/FirstHalfLogo.swf?nocache="+D+M+Y+mill);
    //get time at load initiation
    TALI=getTimer();
    //set interval to do byte check
    li=setInterval(lc,1);
    function lc(){
        l=h.getBytesLoaded();
    	t=h.getBytesTotal();
    	if((l>0 || t>0) && flag==0){flag=1;TAFD=getTimer();}
    	if(l>=t && l>0){
    		TAFL=getTimer();
    		clearInterval(li);
    		nextFrame();
    	}
    }
    Frame 2:
    Code:
    stop();
    //file size
    Fs=h.getBytesTotal();
    //time at first data recieved
    Fd=(TAFD-TALI);
    //time at full load
    Fl=(TAFL-TALI);
    //load time in milliseconds
    Ltms=((TAFL-TALI)-(TAFD-TALI));
    //load time in seconds
    Lts=(((TAFL-TALI)-(TAFD-TALI))/1000);
    //bytes loaded per second
    Bps=(Fs/Lts);
    //dynamic text fields to display data
    fileSize="File size = "+ Fs + " bytes";
    initiated="Load initiated at 0 milliseconds";
    firstData="First data recieved at " + Fd + " milliseconds";
    fullyLoaded="Fully loaded at " + Fl + " milliseconds";
    loadTime="Calculated load time = " + Ltms + " milliseconds or " + Lts + " seconds";
    speed="Calculated download speed for this file= " + Math.ceil(Bps) + " bps";
    Thank you again
    Shipstern
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center