Skip to content

Fil-Naj/Connection-Tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Connection Tester

A simple yet powerful network monitoring tool to track packet loss and response time by pinging Google DNS server.

Background

Since getting a new ISP, I noticed frequent drops when WiFi calling, such as through MS Teams and Messenger, and also while streaming games via Xbox Game Pass. I created this tool to alert me when high latency or major packet loss was expected so that I could pause my game before the connection drop could ruin my progress.

Overview

Connection Tester continuously monitors your internet connection by pinging Google's DNS server (8.8.8.8) at regular intervals. It detects and alerts you about network issues such as:

  • Packet loss
  • High latency spikes
  • Unstable connections

The tool is especially useful for:

  • Troubleshooting intermittent connection problems
  • Detecting network degradation
  • Monitoring connection quality during online gaming or video calls

Features

  • Real-time packet loss and response time monitoring
  • Visual graph display of network metrics (optional)
  • Audio alerts for high latency spikes
  • CSV data export for further analysis
  • Automatic baseline calculation to identify unusual latency
  • Configurable thresholds and settings

Requirements

  • Python 3.6+
  • Required packages:
    • matplotlib
    • numpy

Installation

  1. Clone the repository or download the source code
  2. Install the required packages:
pip install matplotlib numpy

Usage

Run the script using Python:

python main.py

The tool will start monitoring your connection to Google's DNS server and display the results in the console. By default, it will:

  • Play alert sounds when high latency is detected
  • Save results to a CSV file
  • Not display the graph (to conserve resources)

Configuration

You can modify the following variables at the top of the script:

# Global configuration variables
PING_PACKET_COUNT: int = 1  # Number of packets to send in each ping
PING_TIMEOUT_SECONDS: float = 10.0  # Timeout for ping operation
SLEEP_TIMER: float = 1.0  # Sleep time between pings
HIGH_LATENCY_THRESHOLD: float = 1.5  # Warning threshold: current latency > average * threshold
HISTORY_SIZE: int = 50  # Number of recent values to use for baseline average calculation

# Control variables
PLAY_ALERT_SOUND: bool = True  # Whether to play sound on high latency
DISPLAY_PLOT: bool = False  # Whether to display the plot
SAVE_CSV: bool = True  # Whether to save results to CSV file
CSV_OUTPUT_DIR: str = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Metrics")   ## Where to save the metric csv files

Output

The tool provides:

  1. Real-time console output showing packet loss and response time
  2. Audio alerts when high latency is detected
  3. CSV files with detailed data (if enabled)
  4. Interactive graph display (if enabled)

Stopping the Test

Press Ctrl+C to stop the monitoring. The tool will display a summary of the session and save the results if CSV saving is enabled.

Acknowledgements

(Not so) Proudly vibe-coded using GitHub Copilot with Claude 3.7 Sonnet.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages