Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 3.81 KB

README.md

File metadata and controls

71 lines (53 loc) · 3.81 KB

Internet Speed Logger

An application to track your internet download and upload speeds with an elegant web interface.

Preview of Internet Speed Logger

This is a time series based application which continuously monitors your internet connection and plots the results within a responsive web view along with providing basic aggregation of the current visible timeframe (mean). This leverages the official Speedtest.net CLI binary from Ookla to provide the best performance possible.

An early version of this service has been running for many years (~2016) and it has been instrumental for tracking internet performance issues.

To bring it online, simply run:

git clone https://github.com/brennentsmith/internet-speed-logger.git
cd internet-speed-logger
docker-compose up

Wait a couple minutes for MongoDB to initialize, and then go to http://localhost:3000 in your browser, and away you go!

Components

The requrements for Internet Speed Logger are:

  • NodeJS 12-LTS or newer
  • MongoDB

There are three core components to running Internet Speed Logger:

  • Webserver (/index.js) - Webserver which delivers static assets and provides API.
  • Speedrunner (/run-speedtest.js) - Daemon or One Shot process which performs the internet speed test.
  • MongoDB - "Web Scale" persistence layer. 😜

The Webserver and MongoDB must always be running, however the Speedrunner can be either run as a daemon /run-speedtest.js daemon or invoked via cron or SystemD timer as a oneshot process /run-speedtest.js. Both the Webserver and Speedrunner share the common config within /config/default.js.

Configuration

All configuration is held within the /config/default.js directory. The following options are available:

Leaf Default Description
webserver.listenPort 3000 Port which the webserver will listen on
webserver.listenHost 0.0.0.0 Host which the webserver will listen on
db.connectionString mongodb://speedtest:speedtest@mongo:27017/speedtest Connection string the connection for the backend MongoDB compliant database. See: Connection String URI Format
db.collection speedtest Collection to use within MongoDB compliant database.
speedtest.commandString bin/speedtest -f json --accept-license Raw command to execute to perform speed test. Change this if you want it on a different path or specify a specific server.
speedtest.intervalSec 43200 Interval for which the speedtest will be run. This will be randomly skewed +/- 25% and limited to no less than 1800 (30 minutes) seconds between runs.

Running Internet Speed Logger

Container

A container is published to Dockerhub which contains both the webserver and test daemon.

git clone https://github.com/brennentsmith/internet-speed-logger.git
cd internet-speed-logger
docker compose up

You may see some errors upon boot regarding speedlogger-web_1 | MongoNetworkError: failed to connect to server - these are normal as the web service will attempt to create the connection pool before MongoDB is ready. Once MongoDB is ready (~30s), all will work correctly.

Forever

Install the following:

git clone https://github.com/brennentsmith/internet-speed-logger.git
cd internet-speed-logger
<< download latest version of Speedtest-CLI binary to `bin` dir within repo >>
npm ci
forever start index.js
forever start run-speedtest.js daemon