Skip to content

BaseMax/go-net-profiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Network Profiler

A comprehensive Go-based network profiler that measures per-process and per-interface bandwidth usage with real-time visualization.

Features

  • 📊 Real-time bandwidth monitoring - Track network usage as it happens
  • 🖥️ Terminal charts - Beautiful ASCII charts in your terminal
  • 🌐 Web UI - Modern web interface with interactive charts
  • 🔌 Per-interface tracking - Monitor each network interface separately
  • Per-process monitoring - See which processes are using bandwidth (Linux)
  • 📈 Historical summaries - View statistics over time
  • 🚀 Platform-specific adapters - Optimized for different operating systems

Installation

From Source

git clone https://github.com/BaseMax/go-net-profiler.git
cd go-net-profiler
go build -o profiler ./cmd/profiler

Using Go Install

go install github.com/BaseMax/go-net-profiler/cmd/profiler@latest

Usage

Basic Terminal Mode

Start the profiler with default settings (terminal display):

./profiler

With Web UI

Start with web interface on port 8080:

./profiler -web=8080

Then open http://localhost:8080 in your browser.

Custom Update Interval

Update statistics every 2 seconds:

./profiler -interval=2s

Show Summary

Display a summary of collected data:

./profiler -summary

Command-Line Options

-interval duration    Update interval for statistics collection (default 1s)
-history int          Maximum number of historical data points (default 300)
-web int             Port for web UI (0 to disable, default 0)
-terminal            Enable terminal display (default true)
-summary             Show summary and exit (default false)

Examples

Monitor with both terminal and web UI:

./profiler -web=8080 -interval=1s

Web UI only (no terminal display):

./profiler -web=8080 -terminal=false

High-frequency monitoring:

./profiler -interval=500ms -history=600

Platform Support

  • Linux: Full support including per-process statistics via /proc filesystem
  • macOS/Windows: Basic interface statistics (per-process support limited)

Terminal Display Features

The terminal interface shows:

  • Overall bandwidth (download/upload speeds)
  • Real-time ASCII bandwidth chart
  • Per-interface statistics with mini bar charts
  • Top 10 processes by bandwidth usage
  • Historical summary on exit

Web UI Features

The web interface provides:

  • Real-time bandwidth dashboard
  • Interactive Chart.js graphs
  • Network interface table
  • Top processes table
  • Auto-refresh every 5 seconds

Architecture

The project is organized into several packages:

  • stats/ - Platform-specific network statistics collection
  • monitor/ - Bandwidth tracking and historical data management
  • display/ - Terminal visualization
  • web/ - HTTP server with embedded static assets
  • cmd/profiler/ - Main application entry point

Requirements

  • Go 1.21 or later (for embed directive and other features)
  • Linux for per-process monitoring (other platforms support interface monitoring)

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

BaseMax

About

A comprehensive Go-based network profiler that measures per-process and per-interface bandwidth usage with real-time visualization. A network usage profiling and visualization tool.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors