Skip to content

Commit

Permalink
Added stress testing. Runs until top 4 tests speeds are within %10 of…
Browse files Browse the repository at this point in the history
… each other.

add: lodash.min.js because I'm sick of it not being available and I
wanted cloneDeep for stress tests.
  • Loading branch information
snoj committed Nov 9, 2017
1 parent cf462ab commit 343bd92
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 13 deletions.
52 changes: 45 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,52 @@
speedtest
=========
# speedtest

This is a simple NodeJS http "internet" speed test. The aim to make it easy to run a http speedtest over your own WAN, VPN, or whatever network.

Run
=========
# Run

node ./bin/speed.js

Open your browser and go to http://hostname:8080/.

Observations/Bugs
=========
# Default behaviors/config

bin/config.json
```js
{
//local port to listen on.
//can be overridden by setting env ST_PORT
"port": 8080,

//local ip to bind with.
//can be overridden by setting env ST_ADDR
"ip": "0.0.0.0",

"limits": {
//define start, max size, and test series size modifiers.
//server side will not serve up anything larger or accept any more data than is defined here.
"downloadStartSize": "100000"
,"uploadStartSize": "2000000"
,"downloadSizeModifier": "2"
,"uploadSizeModifier": "1.5"
,"maxDownloadSize": "2000000000"
,"maxUploadSize": "100000000"

//tests over this number of seconds kills the test panel.
,"maxDownloadTime": "8"
,"maxUploadTime": "4"

//UI only, milliseconds between tests.
,"restInterval": "0"
}
}
```

### Stress tests
Run until until the min/max of the top 4 tests results are without 10% of each other.


# Observations/Bugs

Original development was on Windows and it seemed to max out at about 20-30MBps (160Mbps - 240Mbps) when using localhost.

Later development has been done on Ubuntu and node v8. The highest speed seen hit ~1.7Gbps on localhost.
Expand All @@ -18,7 +55,8 @@ Credits
=========
* [jQuery](http://jquery.com/)
* [Jquery Ajax Progress](https://github.com/englercj/jquery-ajax-progress) by Chad Engler
* [Knockout](http://knockoutjs.com/)
* [lodash](https://lodash.com)
* [angularjs](https://angularjs.org)
* [dev-zero-stream](https://github.com/mafintosh/dev-zero-stream/blob/f61f06911fc60eb57645d502e53d35a3acfa31d4/index.js) by Mathias Buus
* [orderObjectBy](http://justinklemm.com/angularjs-filter-ordering-objects-ngrepeat/) by Justin Klemm

Expand Down
3 changes: 3 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<button ng-click="$startUpload()" ng-disabled="!!current.all">Upload</button>
<button ng-click="$startBoth()" ng-disabled="!!current.all">Both</button>
<!--<button data-bind="click: $root.stop.bind($root.stop, true)">Stop</button>-->
<button ng-click="$startDownloadStress()" class="download" ng-disabled="!!current.all">Download Stress</button>
<button ng-click="$startUploadStress()" class="download" ng-disabled="!!current.all">Upload Stress</button>
<button ng-click="$clearResults()" ng-disabled="!!current.all">Clear results</button>

<div class="tableout">
Expand Down Expand Up @@ -60,6 +62,7 @@ <h3>

<script type="application/javascript" src="./jquery-3.2.1.min.js" ></script>
<script type="application/javascript" src="./jquery.ajax-progress.js" ></script>
<script type="application/javascript" src="./lodash.min.js"></script>
<script type="application/javascript" src="./angular.min.js"></script>
<script type="application/javascript" src="./speed.js"></script>
</body>
Expand Down
Loading

0 comments on commit 343bd92

Please sign in to comment.