Run ISP speed tests and save results

Related tags

TestingSpeedmon
Overview

SpeedMon

GitHub commit activity Master Travis (.com) semver CodeFactor Grade

Screenshot

Automatically run periodic internet speed tests and save results to a variety of storage backends.

Supported Backends

  • InfluxDB v1
  • InfluxDB v2
  • Graphite

Speed tests are run using the official speedtest.net CLI tool.

Docker, Windows, and Linux are supported. Linux users are required to install the speedtest package first. It will automatically download on Windows.

Configuration

Speedmon can be configured from a configuration file or environment variables. The preferred method is via ENV.

Configuring From ENV

You only need to include the variables for the storage backends you wish to use.

General

DELAY
SERVERS (1234,5431,ect)

Influx v1

--Required--
INFLUXV1_URL
INFLUXV1_DATABASE_NAME
--Optional--
INFLUXV1_NAME
INFLUXV1_PORT
INFLUXV1_USER
INFLUXV1_PASSWORD
INFLUXV1_VERIFY_SSL
INFLUXV1_SSL

Influx v2

--Required--
INFLUXV2_URL
INFLUXV2_TOKEN
INFLUXV2_ORG
INFLUXV2_BUCKET
--Optional--
INFLUXV2_NAME
INFLUXV2_VERIFY_SSL

Graphite v2

--Required--
GRAPHITE_URL
GRAPHITE_PREFIX
--Optional--
GRAPHITE_NAME
GRAPHITE_PORT

Configuring From .ini

When initializing Speedmon looks for the SPEEDTEST_CONFIG ENV Variable to know what config file to load. If this variable is not provided, Speedmon will attempt to load settings from ENV.

Storage backends are dynamically loaded based on what is in the config file. You can safely delete the sections for backends not in use.

[GENERAL]
Delay = 360
Servers = 
[INFLUXV1]
Name = Whatever You want
Url = http://localhost
Port = 8086
Database_name = speedtests
User = 
Password =
SSL = False
Verify SSL = False
[INFLUXV2]
Name = Whatever You want
Url = http://localhost
Token =
Org = 
Bucket = 
Verify SSL = False
[Graphite]
Name = Whatever You want
Url = http://localhost
Port = 2003
Prefix = speedtest

Usage

With Docker

See ENV Variable List For Your Storage Backend

docker run -d \
--name="speedtest" \
--restart="always" \
--env INFLUXV2_URL=http://example.com \
--env INFLUXV2_TOKEN=my-long-token \
--env INFLUXV2_ORG=my-org \
--env INFLUXV2_BUCKET=speedtests \
--env DELAY=360 \
barrycarey/speedmon:latest

Using Optional Configuration File

If you do not want to configure Speedmon with ENV variables you can us configuration file

  1. Make a directory to hold the config.ini file. Navigate to that directory and download the sample config.ini in this repo.
mkdir speedmon
curl -o speedmon/config.ini https://raw.githubusercontent.com/barrycarey/Speedmon/master/config.ini
cd speedmon
  1. Modify the config file with your influxdb settings.
nano config.ini

Remove the unneeded storage backend sections. Modify the remaining settings to fit our requirements

[GENERAL]
Delay = 360
# Leave blank to auto pick server
Servers =


[INFLUXV2]
Name = Influx v2
URL = = http://localhost:8086
Token = abc12345676
Org = my-org
Bucket = speedtests
Verify_SSL = False


  1. Run the container, pointing to the directory with the config file. This should now pull the image from Docker hub.
docker run -d \
--name="speedtest" \
-v config.ini:/src/config.ini \
--restart="always" \
--env SPEEDTEST_CONFIG=config.ini
barrycarey/speedmon:latest

Before the first use run pip3 install -r requirements.txt

Enter your desired information in config.ini

Run influxspeedtest.py

Adding Additional Backends

If you wish to contribute support for additional backends the process is straight forward.

Add a new Package under speedmon.storage. Create a new Storage Handler that inherits from StorageHandlerBase. Create a new config that inherits from StorageConfig. Add the new storage backed to speedmon.storage.storage_config_map

Add the example config options to config.ini and name the section [HANDLERNAME]. This must match the name you specified in the map

The handler will automatically be loaded and initialized if the config options are available in the config.ini or ENV vars

Owner
Matthew Carey
IT Technician by day, wannabe developer at night.
Matthew Carey
PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive tasks.

PyAutoEasy PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive t

Dingu Sagar 7 Oct 27, 2022
pytest plugin for manipulating test data directories and files

pytest-datadir pytest plugin for manipulating test data directories and files. Usage pytest-datadir will look up for a directory with the name of your

Gabriel Reis 191 Dec 21, 2022
py.test fixture for benchmarking code

Overview docs tests package A pytest fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. See c

Ionel Cristian Mărieș 1k Jan 03, 2023
Pytest-typechecker - Pytest plugin to test how type checkers respond to code

pytest-typechecker this is a plugin for pytest that allows you to create tests t

vivax 2 Aug 20, 2022
API mocking with Python.

apyr apyr (all lowercase) is a simple & easy to use mock API server. It's great for front-end development when your API is not ready, or when you are

Umut Seven 55 Nov 25, 2022
Browser reload with uvicorn

uvicorn-browser This project is inspired by autoreload. Installation pip install uvicorn-browser Usage Run uvicorn-browser --help to see all options.

Marcelo Trylesinski 64 Dec 17, 2022
A Simple Unit Test Matcher Library for Python 3

pychoir - Python Test Matchers for humans Super duper low cognitive overhead matching for Python developers reading or writing tests. Implemented in p

Antti Kajander 15 Sep 14, 2022
Plugin for generating HTML reports for pytest results

pytest-html pytest-html is a plugin for pytest that generates a HTML report for test results. Resources Documentation Release Notes Issue Tracker Code

pytest-dev 548 Dec 28, 2022
Obsei is a low code AI powered automation tool.

Obsei is a low code AI powered automation tool. It can be used in various business flows like social listening, AI based alerting, brand image analysis, comparative study and more .

Obsei 782 Dec 31, 2022
ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries.

ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries. With this f

Mustafa 1 Jul 11, 2022
create custom test databases that are populated with fake data

About Generate fake but valid data filled databases for test purposes using most popular patterns(AFAIK). Current support is sqlite, mysql, postgresql

Emir Ozer 2.2k Jan 04, 2023
The source code and slide for my talk about the subject: unittesing in python

PyTest Talk This talk give you some ideals about the purpose of unittest? how to write good unittest? how to use pytest framework? and show you the ba

nguyenlm 3 Jan 18, 2022
HTTP traffic mocking and testing made easy in Python

pook Versatile, expressive and hackable utility library for HTTP traffic mocking and expectations made easy in Python. Heavily inspired by gock. To ge

Tom 305 Dec 23, 2022
This is a simple software for fetching new changes to remote repositories automatically.

Git Autofetch Git Autofetch is a simple software for fetching new changes from a repo to local repositories after a set time interval. This program is

Shreyas Ashtamkar 10 Jul 21, 2022
Rerun pytest when your code changes

A simple watcher for pytest Overview pytest-watcher is a tool to automatically rerun pytest when your code changes. It looks for the following events:

Olzhas Arystanov 74 Dec 29, 2022
Pytest-rich - Pytest + rich integration (proof of concept)

pytest-rich Leverage rich for richer test session output. This plugin is not pub

Bruno Oliveira 170 Dec 02, 2022
A framework-agnostic library for testing ASGI web applications

async-asgi-testclient Async ASGI TestClient is a library for testing web applications that implements ASGI specification (version 2 and 3). The motiva

122 Nov 22, 2022
This is a pytest plugin, that enables you to test your code that relies on a running MongoDB database

This is a pytest plugin, that enables you to test your code that relies on a running MongoDB database. It allows you to specify fixtures for MongoDB process and client.

Clearcode 19 Oct 21, 2022
How to Create a YouTube Bot that Increases Views using Python Programming Language

YouTube-Bot-in-Python-Selenium How to Create a YouTube Bot that Increases Views using Python Programming Language. The app is for educational purpose

Edna 14 Jan 03, 2023