How nawids/networkanalyzer works
Network Quality Monitor is a background service that periodically probes configured internet endpoints, persists quality measurements, evaluates alert thresholds, and serves a local dashboard. Its main workflow runs download, upload, and latency probes; stores the resulting metrics; and makes them available for charts and alerting. The README also documents endpoint rotation, retention, configuration reload, and graceful shutdown. The supplied tree omits the documented command and monitor packages, so their orchestration links are shown only where the README supports them; unsampled wiring is not inferred.
Main entry points: config.go Config loader · engine.go Probe engine · store.go SQLite store · alert.go Threshold evaluation
Components 18
Configuration
- YAML settings
config.example.yaml - Config loader
internal/config/config.go - Config reload
Measurement
- Probe scheduler
- Probe engine
internal/engine/engine.go - Metric calculations
internal/engine/calc.go - Probe and alert models
internal/types/types.go
Persistence
- SQLite store
internal/store/store.go - SQLite database
Dashboard
- HTTP dashboard
internal/dashboard/dashboard.go - Statistics
internal/dashboard/stats.go
Alerting
- Threshold evaluation
internal/alert/alert.go - Email notifier
internal/alert/notifier.go
Other components
- Operator
- Network endpoints
- Latency target
- Dashboard user
- SMTP service
Connections 24
- Operator → YAML settings: sets options
README.md - YAML settings → Config loader: loads YAML
internal/config/config.go - Config loader → Probe scheduler: configures
README.md - Operator → Config reload: signals reload
README.md - Config reload → Config loader: reloads settings
README.md - Probe scheduler → Probe engine: runs probes
README.md - Config loader → Probe engine: configures
internal/engine/engine.go - Probe engine → Network endpoints: measures speeds
internal/engine/engine.go - Probe engine → Latency target: dials TCP
internal/engine/engine.go - Probe engine → Metric calculations: computes metrics
internal/engine/engine.go - Probe engine → Probe and alert models: returns result
internal/engine/engine.go - Probe scheduler → SQLite store: persists results
README.md - SQLite store → SQLite database: reads and writes
internal/store/store.go - SQLite store → Probe and alert models: maps results
internal/store/store.go - Dashboard user → HTTP dashboard: requests dashboard
README.md - HTTP dashboard → SQLite store: queries results
internal/dashboard/dashboard.go - HTTP dashboard → Statistics: computes stats
internal/dashboard/dashboard.go - Statistics → Probe and alert models: aggregates metrics
internal/dashboard/stats.go - Probe scheduler → Threshold evaluation: evaluates results
README.md - Config loader → Threshold evaluation: provides thresholds
internal/alert/alert.go - Threshold evaluation → Probe and alert models: builds alert
internal/alert/alert.go - Threshold evaluation → Email notifier: dispatches alert
internal/alert/alert.go - Config loader → Email notifier: provides SMTP settings
internal/alert/notifier.go - Email notifier → SMTP service: sends email
internal/alert/notifier.go