b2cNetworkMonitor

A self-hosted dashboard that tracks an office connection's latency and bandwidth over time.

Role
Design and engineering
Areas
Tools

When an office connection feels slow, the useful question is whether it's slow at certain hours, and for how long. b2cNetworkMonitor answers it by measuring all the time.

It runs as a long-lived process on a machine in the office. A background scheduler pings on a fixed interval and runs a bandwidth test less often, with both intervals configurable, and stores every sample in a local SQLite database. Ping flags adapt to the platform, so it runs on Linux, macOS and Windows.

Four-layer diagram of b2cNetworkMonitor: a scheduler thread pings every 10 minutes, runs a speed test every 30 minutes and writes daily and weekly reports; results go to two SQLite tables plus HTML reports with charts; a Flask app serves a Chart.js dashboard, JSON time-series endpoints and a report browser; and any browser on the local network can open it.
A background thread does the measuring while Flask serves the dashboard from the same process.

A small Flask app serves a single-page dashboard with Chart.js charts and JSON endpoints for latency and bandwidth over a chosen lookback window, so any device on the local network can check it. Once a day and once a week it writes a human-readable HTML report with matplotlib charts, and those reports can be browsed from the same dashboard.

Two-column table of the SQLite schema. latency_log holds a local timestamp, the ping target, latency in milliseconds and a success flag. bandwidth_log holds a local timestamp, download and upload speed in megabits per second, ping in milliseconds, and the speed-test server's name and sponsor.
Failed pings are logged too, so outages show up in the record as well as slowdowns.