Giter VIP home page Giter VIP logo

connection-analyzer's Introduction

Connection Analyzer

⏱️ ⏱️ ⏱️

Connection analyzer is a utility tool to monitor your internet connection. It's a simple Python script that does a speedtest every 8 hours and sends you an email with the latest values.

Emails are temporary disabled

Installation

To use the script you have to download it (and its dependencies) and give it permissions to execute.

$ pip install speedtest-cli==2.1.2
$ git clone https://github.com/0xfederama/connection-analyzer.git
$ cd connection-analyzer
$ chmod +x script.py

Now you can launch the script with python3 script.py. man If you want to execute the script every time you turn on your computer (or your raspberrypi) you have to add python3 /absolute/path/to/script.py & at the end of the file /etc/rc.local, just before the line that has exit 0, and reboot.

Customization

You can customize the script as you want. The first thing that you can customize is the email (line 4-5): if you don't want to receive an email leave the field blank as it is, otherwise write your own email and password. If you don't want to receive emails, only change this field. Emails are temporary disabled

You can customize also the value of the hours (line 6). With a default value of 6, you will receive an email every 6 hours. After 8 hours, the dictionary will be reset to default values, in order to check if, in a 6-hour span, the connection has had problems (otherwise, the average in a long span of hours will flatten the curve).

Since the json file is never read by the program, if you change the values of the json it doesn't affect the program.

How to check internet speed values

When you want to check the latest values of your internet speed, you can view the json file stored in ~/.config/connection-analyzer. That file will be overwritten the next time that your internet speed is tested (in 15 minutes).

If you want to save a file, you can just change the name of the json file that you don't want to be overwritten. Anyway, if your connection speed drops by 75%, the script will automatically save a new json with the date of the issue in the same directory.

Json example

{
    "email": "",
    "hours": 6,
    "last_hours": {
        "date": "2021-04-02 @ 13:15",
        "network-name": "Wi-Fi",
        "avg_download": 46.77,
        "avg_upload": 19.86,
        "avg_ping": 22.56,
        "min_download": 42.1,
        "max_download": 53.47,
        "min_upload": 18.23,
        "max_upload": 22.01,
        "min_ping": 16.38,
        "max_ping": 26.98
    }
}

connection-analyzer's People

Contributors

0xfederama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

connection-analyzer's Issues

add requirements.txt

write down the dependencies in a requirements.txt the project uses, such that others can install them with pip.

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.