Skip to content

Add network-aware history and speed tests - #1

Open
rsheyd wants to merge 13 commits into
PixelTowers:mainfrom
rsheyd:agent/network-history-speed-tests
Open

Add network-aware history and speed tests#1
rsheyd wants to merge 13 commits into
PixelTowers:mainfrom
rsheyd:agent/network-history-speed-tests

Conversation

@rsheyd

@rsheyd rsheyd commented Jul 17, 2026

Copy link
Copy Markdown

Why

Brief connection problems are difficult to compare from memory alone. This change extends PingZilla's existing continuous latency history so a user can answer two questions with recorded evidence:

  • Which connection was active at a particular time?
  • How was that connection behaving?

The motivating case is comparing coffee-shop Wi-Fi with a personal hotspot when both occasionally exhibit short glitches.

What changed

Network-aware history

  • Associates ping samples with network sessions based on the public IP and ISP fingerprint already available to PingZilla.
  • Starts a new session after detected network changes, meaningful reconnects, and sufficiently long sleep gaps.
  • Splits the historical line at session boundaries so the graph does not imply a latency spike between different connections.
  • Gives known networks stable colors across sessions.
  • Lets users assign a readable network name when SSID access is unavailable or restricted.
  • Migrates existing persisted history into an unknown legacy session and continues retaining approximately 24 hours of data.

Interactive graph and session details

  • Applies the selected 5m, 30m, 1h, or 24h statistics range to the historical graph.
  • Makes latency points selectable and shows the timestamp, ping/timeout, session duration, median, average, p95, and packet loss.
  • Preserves hover highlighting and point selection when speed-test markers are present.
  • Uses standalone reference dots for speed-test markers so their one-point dataset does not take over Recharts tooltip indexing.

Short, optional speed tests

  • Adds a user-triggered capacity test using the macOS-specific /usr/bin/networkQuality command.
  • Records download and upload capacity with the active network session.
  • Uses a seven-second default to limit time, data transfer, battery use, and disruption.
  • Allows the duration to be configured from 3–30 seconds.
  • Shows a countdown while the test is running and displays the result at its recorded local time.
  • Includes a signed-bundle smoke-test entry point for validating networkQuality availability.

Shutdown and contributor workflow

  • Defers shutdown out of the native menu callback, persists current state, and guards against duplicate Quit requests.
  • Preserves native tray menu items and updates their labels in place, avoiding menu replacement while AppKit processes user interactions.
  • Rebuilds the tray menu only when site monitors are added or removed.
  • Adds local development, validation, production-bundle, ad-hoc signing, and manual testing instructions.

Screenshot

Network-aware latency history with selected session details and a speed-test marker

Validation

  • pnpm build
  • cargo fmt --check --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml — 7 tests passed
  • Full pnpm tauri build completed successfully and produced both the macOS app and DMG.
  • Interactive browser regression test with 30 minutes of fixture history and a recorded speed test:
    • hover highlighting moved between latency points
    • distinct points were selectable in both 5m and 30m ranges
    • selecting the speed-test marker displayed its associated result
  • Manual development-app testing covered the network-name editor, speed-test countdown, graph selection, and Quit behavior.
  • Production bundle built with pnpm tauri build --bundles app, ad-hoc signed with src-tauri/Entitlements.plist, and verified with codesign --verify --deep --strict.
  • Manual testing in that signed production bundle confirmed:
    • the seven-second speed-test countdown and sandboxed networkQuality execution
    • saved download/upload results and a selectable graph marker
    • hover highlighting and distinct point selection in both 5m and 30m ranges after a speed test
    • network naming
    • history, network names, and speed-test persistence after relaunch
    • clean shutdown from the native Quit menu without a crash
    • Wi-Fi ↔ hotspot transition detection

Additional release checks

The following transitions would still benefit from broader testing before release:

  • sleep/wake and meaningful reconnects
  • VPN transitions
  • migration from older persisted history

networkQuality is intentionally treated as a macOS-specific first implementation. The backend should be revisited if packaging, sandboxing, or Mac App Store review makes direct invocation unsuitable.

@rsheyd
rsheyd marked this pull request as ready for review July 17, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant