Skip to content

Commit

Permalink
Replaced speedtest with speed test
Browse files Browse the repository at this point in the history
  • Loading branch information
adolfintel committed Aug 28, 2023
1 parent 5956e07 commit 6a4a05d
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

No Flash, No Java, No Websocket, No Bullshit.

This is a very lightweight Speedtest implemented in Javascript, using XMLHttpRequest and Web Workers.
This is a very lightweight speed test implemented in Javascript, using XMLHttpRequest and Web Workers.

## Try it
[Take a Speedtest](https://librespeed.org)
[Take a speed test](https://librespeed.org)

## Compatibility
All modern browsers are supported: IE11, latest Edge, latest Chrome, latest Firefox, latest Safari.
Expand Down
60 changes: 30 additions & 30 deletions doc.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you want to install LibreSpeed on a single server, you need to configure it i
The test can be accessed on port 80.

Here's a list of additional environment variables available in this mode:
* __`TITLE`__: Title of your speedtest. Default value: `LibreSpeed`
* __`TITLE`__: Title of your speed test. Default value: `LibreSpeed`
* __`TELEMETRY`__: Whether to enable telemetry or not. Default value: `false`
* __`ENABLE_ID_OBFUSCATION`__: When set to true with telemetry enabled, test IDs are obfuscated, to avoid exposing the database internal sequential IDs. Default value: `false`
* __`REDACT_IP_ADDRESSES`__: When set to true with telemetry enabled, IP addresses and hostnames are redacted from the collected telemetry, for better privacy. Default value: `false`
Expand Down
8 changes: 4 additions & 4 deletions docker/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function I(i){return document.getElementById(i);}
//LIST OF TEST SERVERS. See documentation for details if needed
var SPEEDTEST_SERVERS= <?= file_get_contents('/servers.json') ?: '[]' ?>;

//INITIALIZE SPEEDTEST
var s=new Speedtest(); //create speedtest object
//INITIALIZE SPEED TEST
var s=new Speedtest(); //create speed test object
<?php if(getenv("TELEMETRY")=="true"){ ?>
s.setParameter("telemetry_level","basic");
<?php } ?>
Expand Down Expand Up @@ -112,7 +112,7 @@ function format(d){
var uiData=null;
function startStop(){
if(s.getState()==3){
//speedtest is running, abort
//speed test is running, abort
s.abort();
data=null;
I("startStopBtn").className="";
Expand Down Expand Up @@ -432,7 +432,7 @@ function initUI(){
</div>
<div id="privacyPolicy" style="display:none">
<h2>Privacy Policy</h2>
<p>This HTML5 Speedtest server is configured with telemetry enabled.</p>
<p>This HTML5 speed test server is configured with telemetry enabled.</p>
<h4>What data we collect</h4>
<p>
At the end of the test, the following data is collected and stored:
Expand Down
8 changes: 4 additions & 4 deletions docker/standalone.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<script type="text/javascript" src="speedtest.js"></script>
<script type="text/javascript">
function I(i){return document.getElementById(i);}
//INITIALIZE SPEEDTEST
var s=new Speedtest(); //create speedtest object
//INITIALIZE SPEED TEST
var s=new Speedtest(); //create speed test object
<?php if(getenv("TELEMETRY")=="true"){ ?>
s.setParameter("telemetry_level","basic");
<?php } ?>
Expand Down Expand Up @@ -65,7 +65,7 @@ function format(d){
var uiData=null;
function startStop(){
if(s.getState()==3){
//speedtest is running, abort
//speed test is running, abort
s.abort();
data=null;
I("startStopBtn").className="";
Expand Down Expand Up @@ -324,7 +324,7 @@ function initUI(){
</div>
<div id="privacyPolicy" style="display:none">
<h2>Privacy Policy</h2>
<p>This HTML5 Speedtest server is configured with telemetry enabled.</p>
<p>This HTML5 speed test server is configured with telemetry enabled.</p>
<h4>What data we collect</h4>
<p>
At the end of the test, the following data is collected and stored:
Expand Down
6 changes: 3 additions & 3 deletions example-multipleServers-full.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
];

//INITIALIZE SPEEDTEST
var s=new Speedtest(); //create speedtest object
var s=new Speedtest(); //create speed test object
s.setParameter("telemetry_level","basic"); //enable telemetry

//SERVER AUTO SELECTION
Expand Down Expand Up @@ -122,7 +122,7 @@
var uiData=null;
function startStop(){
if(s.getState()==3){
//speedtest is running, abort
//speed test is running, abort
s.abort();
data=null;
I("startStopBtn").className="";
Expand Down Expand Up @@ -447,7 +447,7 @@ <h3>Share results</h3>
</div>
<div id="privacyPolicy" style="display:none">
<h2>Privacy Policy</h2>
<p>This HTML5 Speedtest server is configured with telemetry enabled.</p>
<p>This HTML5 speed test server is configured with telemetry enabled.</p>
<h4>What data we collect</h4>
<p>
At the end of the test, the following data is collected and stored:
Expand Down
2 changes: 1 addition & 1 deletion example-singleServer-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h4>Latency</h4>
document.getElementById('ping').textContent = data.pingStatus + ' ms, ' + data.jitterStatus + ' ms jitter'
document.getElementById('ip').textContent = data.clientIp
}
s.start(); // start the speedtest with default settings
s.start(); // start the speed test with default settings
</script>

<a href="https://github.com/librespeed/speedtest">Source code</a>
Expand Down
2 changes: 1 addition & 1 deletion example-singleServer-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ <h2>Latency</h2>
<br/>
<a href="javascript:abortTest()" id="abortBtn">Abort</a>
</div>
<a href="javascript:runTest()" id="startBtn">Run speedtest</a>
<a href="javascript:runTest()" id="startBtn">Run speed test</a>
<br/><br/> Charts by <a href="http://www.chartjs.org/">Chart.js</a><br/><br/><a href="https://github.com/librespeed/speedtest">Source code</a>
</body>
</html>
2 changes: 1 addition & 1 deletion example-singleServer-full.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ <h3>Share results</h3>
</div>
<div id="privacyPolicy" style="display:none">
<h2>Privacy Policy</h2>
<p>This HTML5 Speedtest server is configured with telemetry enabled.</p>
<p>This HTML5 speed test server is configured with telemetry enabled.</p>
<h4>What data we collect</h4>
<p>
At the end of the test, the following data is collected and stored:
Expand Down
10 changes: 5 additions & 5 deletions speedtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
*/

/*
This is the main interface between your webpage and the speedtest.
It hides the speedtest web worker to the page, and provides many convenient functions to control the test.
This is the main interface between your webpage and the speed test.
It hides the speed test web worker to the page, and provides many convenient functions to control the test.
The best way to learn how to use this is to look at the basic example, but here's some documentation.
To initialize the test, create a new Speedtest object:
var s=new Speedtest();
Now you can think of this as a finite state machine. These are the states (use getState() to see them):
- 0: here you can change the speedtest settings (such as test duration) with the setParameter("parameter",value) method. From here you can either start the test using start() (goes to state 3) or you can add multiple test points using addTestPoint(server) or addTestPoints(serverList) (goes to state 1). Additionally, this is the perfect moment to set up callbacks for the onupdate(data) and onend(aborted) events.
- 0: here you can change the speed test settings (such as test duration) with the setParameter("parameter",value) method. From here you can either start the test using start() (goes to state 3) or you can add multiple test points using addTestPoint(server) or addTestPoints(serverList) (goes to state 1). Additionally, this is the perfect moment to set up callbacks for the onupdate(data) and onend(aborted) events.
- 1: here you can add test points. You only need to do this if you want to use multiple test points.
A server is defined as an object like this:
{
Expand Down Expand Up @@ -46,7 +46,7 @@
function Speedtest() {
this._serverList = []; //when using multiple points of test, this is a list of test points
this._selectedServer = null; //when using multiple points of test, this is the selected server
this._settings = {}; //settings for the speedtest worker
this._settings = {}; //settings for the speed test worker
this._state = 0; //0=adding settings, 1=adding servers, 2=server selection done, 3=test running, 4=done
console.log(
"LibreSpeed by Federico Dossena v5.2.5 - https://github.com/librespeed/speedtest"
Expand All @@ -66,7 +66,7 @@ Speedtest.prototype = {
* - parameter: string with the name of the parameter that you want to set
* - value: new value for the parameter
*
* Invalid values or nonexistant parameters will be ignored by the speedtest worker.
* Invalid values or nonexistant parameters will be ignored by the speed test worker.
*/
setParameter: function(parameter, value) {
if (this._state == 3)
Expand Down

0 comments on commit 6a4a05d

Please sign in to comment.