/SpeedTest-Bot

Bot running speed tests continuously

Primary LanguageJavaScriptMIT LicenseMIT

Speed Test Bot

Status GitHub Issues GitHub Pull Requests License


Bot running speed tests continuously.

📝 Table of Contents

🧐 About

Bot that continuosly runs speed test (from various sites), generating a json file containing the results. It plots the results in an interactive graph, too.
It helps check the internet speed throughout a long period of time.

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js v10.xx.x (probably works with more recent versions, too)
  • Npm / Yarn
  • Plotly free account (only if you want to get a chart of your speed test results)

Installing

Clone/Download the repository.

git clone https://github.com/jackroi/SpeedTest-Bot.git

Enter into SpeedTest-Bot folder and install the required packages using yarn or npm. It can take a few minutes, because puppeteer need to download chromium.

cd SpeedTest-Bot
yarn install

Configure Speed Test Bot following these steps.

Check whether the installation was successful.

yarn start -h

It sholud output a help text.

⚙️ Configuration

Rename or copy config-example.json to config.json, and change the content as you prefer, using your favourite text editor.

cp config-example.json config.json
  • output_file: name of the output file, where the results will be stored
  • headless:
    • true for activating headless mode (might not work flawlessly, see known issues section)
    • false for disabling headless mode (works better but can be frustrating if you're using the pc meanwhile)
  • time:
    • infinity: the bot stops only when CTRL-C is pressed
    • how many seconds the bot should run
  • plot.username: plotly username
  • plot.api_key: plotly api key
  • plot.generate_image:
    • true if you do want a picture of the chart saved on your pc
    • false if you don't want the picture of the chart saved on your pc

🎈 Usage

yarn start -r | yarn start --run
Runs speedtests continuosly, it stops when you press CTRL-C or when the amount of time specified in config.json has elapsed. The results are saved into output folder.

yarn start -c | yarn start --clean
Generates two json files: one will contain the results divided by provider, the other will contain the results divided by type (single or multiple connections). The results are saved into output folder.

yarn start -p | yarn start --plot
Plots the results in a chart viewable online at the given URL or as an image (needs a plotly api key, for more informations read the readme.txt file). The resulting image is saved into output folder.

yarn start -s | yarn start --show
Shows the current settings stored in config.json.

❗️ Known Issues

  • When headless mode is active, the bot stops at apparently random moments for apparently random periods, and then it normally resumes execution as if nothing had happened. The issues may be caused by different behaviours between headless mode and non headless mode.

⛏️ Built Using

✍️ Authors

See also the list of contributors who participated in this project.