Giter Site home page Giter Site logo

davidpesticcio / speedtest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robinmanuelthiel/speedtest

1.0 1.0 0.0 121 KB

Check internet bandwidth from a Docker container and save the results to an InfluxDB

License: MIT License

Dockerfile 24.04% Shell 75.96%

speedtest's Introduction

Internet Speed Test in a Container

Check your internet bandwidth using the Speedtest CLI from a Docker container. You can configure the tool to run periodically and save the results to an InfluxDB for visualization or long-term records.

$ docker run --rm robinmanuelthiel/speedtest:latest

The result will then look like this:

Running a Speed Test...
Your download speed is 334 Mbps (29284399 Bytes/s).
Your upload speed is 42 Mbps (4012944 Bytes/s).

Configuration

Environment variable Default value Description
LOOP false Run Speedtest in a loop
LOOP_DELAY 60 Delay in seconds between the runs
DB_SAVE false Save values to InfluxDB
DB_HOST http://localhost:8086 InfluxDB Hostname
DB_NAME speedtest InfluxDB Database name
DB_USERNAME admin InfluxDB Username
DB_PASSWORD password InfluxDB Password

Grafana and InfluxDB

Screenshot of a Grafana Dashboard with upload and download speed values

For a full visualization and long term tracking, I recommend InfluxDB as a time-series database and Grafana as a dashboard engine. Both come in Docker containers, so the whole setup can be achieved by starting a Docker Compose file.

version: "3"
services:
  grafana:
    image: grafana/grafana:latest
    restart: always
    ports:
      - 3000:3000
    volumes:
      - grafana:/var/lib/grafana

  influxdb:
    image: influxdb
    volumes:
      - influxdb:/var/lib/influxdb
    ports:
      - 8083:8083
      - 8086:8086
    environment:
      - INFLUXDB_ADMIN_USER="admin"
      - INFLUXDB_ADMIN_PASSWORD="password"
      - INFLUXDB_DB="speedtest"

  speedtest:
    image: robinmanuelthiel/speedtest:latest
    environment:
      - LOOP=true
      - LOOP_DELAY=1800
      - DB_SAVE=true
      - DB_HOST=http://influxdb:8086
      - DB_NAME=speedtest
      - DB_USERNAME=admin
      - DB_PASSWORD=password

volumes:
  grafana:
  influxdb:

To configure Grafana, we need to add InfluxDB as a data source and create a dashboard with the upload and download values. You can find a demo dashboard configuration in the /demo folder.

Hint: The speedtest outputs values as bytes per second. Make sure to divide all values by 125000 in your dashboard to get the Mbps values.

speedtest's People

Contributors

robinmanuelthiel avatar

Stargazers

David Pesticcio avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.