Skip to content

NSS internal app for internet connection speed test visualization.

License

Notifications You must be signed in to change notification settings

NewEvolution/speedtest

Repository files navigation

Speedtest

A NodeJS API serving internet connection statistics from MongoDB to a React front end, with D3 data visualization.

speedtest screenshot

About

This app was written as an internal tool for Nashville Software School to display periodic internet speed test data in an easily navigable interface.

Prior to creation of this app I had a long-running script running speedtest-cli and storing hourly speed test information in a simple text file. The import.js file in the utilities directory was crafted to parse this file and submit them via an HTTP POST to /speedtest for storage in MongoDB.

Get requests to /speedtest initiate a new speed test via speedtest-cli and save the returned data to MongoDB.

Included Components

Installation & Execution

  • Install NodeJS
  • Install speedtest-cli
  • Install MongoDB
  • Start MongoDB by running mongod in a terminal
  • Clone down this repository
  • In a terminal within the repository directory:
    • Install required Node modules by running npm install
    • Generate output files by running ./node_modules/.bin/webpack
    • Start the server by running node server.js

Usage

Full Site
  • In the browser of your choice, go to http://localhost:3000/speedtest a few times to populate the database with some speed test results.
  • For gathering periodic results you could write a simple cron job running curl or wget to hit http://localhost:3000/speedtest hourly.
  • Navigate to http://localhost:3000 to view the visualization of the speed test data in the database.
  • The top day, week, month & year time span buttons control the span of time displayed in the graph.
  • Left and right navigation buttons jump forward and back in time by the amount selected by the time span buttons.
  • Clicking the displayed dates opens a calendar chooser to select a custom time range for display.
API

Configuration

The file src/config.js contains a configuration object for the React front end.

  • apiurl - hostname:port for connecting to the API. Default of localhost:3000.
  • firstscan - YYYY-MM-DD formatted date string for the first scan in the database. Default of 2016-04-25.

Several environment variables can be used for additional configuration.

  • MONGODB_USER - Username for connecting to MongoDB. Defaults to empty string.
  • MONGODB_PASS - Password for connecting to MongoDB. Defaults to empty string.
  • MONGODB_HOST - URL for MongoDB connection. Defaults to localhost.
  • MONGODB_PORT - Port used for connecting go MongoDB. Defaults to 27017.
  • PORT - Port the Node web server listens on. Defaults to 3000.

About

NSS internal app for internet connection speed test visualization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published