Skip to content

Real-time TCP ping tool with live charts and CSV logs for monitoring network stability and latency spikes.

License

Notifications You must be signed in to change notification settings

CookieDelta/network_monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time TCP Ping with Visualization and Historical Logging

Description

This script was born from a real scenario: a friend experienced connection issues while playing multiplayer games in GT7.
Even though his connection measured well (400 Mbps download, 160 Mbps upload) and NAT2, he still suffered disconnections.

The goal of this project is to collect detailed connection data and monitor network stability over time, to analyze latency spikes, high-latency events, and packet losses.

Live Ping Chart App Running


Why not use the traditional ping command

  • Running ping from the OS requires special privileges (raw sockets), which can cause errors when using scripts or running as a compiled executable (.exe).
  • Some traditional methods also fail when executed from a PyInstaller-generated executable.

Therefore, this script uses TCP ping, creating brief connections to a target port (default: Google DNS 8.8.8.8, port 53).
This allows measuring connection latency without special privileges, and better reflects real-world performance in TCP/online applications.


Main Features

  1. Real-time TCP ping and network stability monitoring:
    • Live chart showing the last 100 ping samples.
    • Background color bands according to latency:
      • Green: good (< 60 ms)
      • Yellow: moderate (60–100 ms)
      • Red: high (> 100 ms)
    • Packet losses marked with red 'X'.
    • Current ping displayed in the top-left corner.
  2. Historical logging:
    • Each ping saved to a CSV in a runs/ folder.
    • Columns: timestamp, latency in ms (or DROP if packet lost).
    • Automatic creation of the folder and unique CSV names by date/time.
  3. Local and historical statistics:
    • Maximum latency in the last 100 samples.
    • Count of high-latency events (> threshold).
    • Packet loss percentage.

Output

The final product can be compiled into a standalone executable (.exe) using PyInstaller, so it can be run on any PC without installing Python or dependencies.
All CSV logs will be saved in the runs/ folder next to the executable.


Configuration

  • HOST → target host to ping (default: 8.8.8.8)
  • PORT → TCP port for ping (default: 53)
  • max_points → number of recent points shown on the chart (default: 100)
  • thresholds → tuple for latency bands in ms, e.g., (60, 100) for green/yellow/red

About

Real-time TCP ping tool with live charts and CSV logs for monitoring network stability and latency spikes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages