wtfi 0.7.0 can save every sweep, so yesterday's dead zone stays on the graph

3 hours ago

This is wtfi, the terminal tool that draws your connection as a chain of hops and shows where it breaks. Until now, its live trend lines started from scratch every time you opened it. Version 0.7.0 adds two flags. Record saves each sweep to a file on disk, and history reads them back, so a dead zone you walked through yesterday is still on the graph today.

Ask about this presentation

Chapters

  1. 0:00Yesterday's dead zone stays on the graph
  2. 0:23--record
  3. 0:46history.jsonl
  4. 1:09--history
  5. 1:32-w --record
  6. 1:52Recording is opt-in
  7. 2:17Install 0.7.0
Show transcript
  1. This is wtfi, the terminal tool that draws your connection as a chain of hops and shows where it breaks. Until now, its live trend lines started from scratch every time you opened it. Version 0.7.0 adds two flags. Record saves each sweep to a file on disk, and history reads them back, so a dead zone you walked through yesterday is still on the graph today.

    Slide text
    wtfi2 · v0.7.0
    --record --history

    wtfi 0.7.0 can save every sweep, so yesterday's dead zone stays on the graph

    wtfi -w: the live dashboard catching a DNS-only outage and its recovery
  2. The first flag is record. Add it to a run, and when the sweep finishes, wtfi appends one line of JSON to a history file. Each line keeps the numbers a trend is drawn from: when it ran, the overall status, the first hop that broke, the verdict headline, latency to your router and across the WAN, WAN packet loss, and your Wi-Fi signal strength.

    Slide text
    wtfi2 v0.7.0
    --record history.jsonl --history -w --record opt-in
    wtfi --record

    Each finished sweep becomes one line of JSON

    what one line holds
    ts when it ran, Unix seconds status the overall verdict first_break the first hop that broke headline the verdict line gateway_ms latency to your router wan_ms WAN latency wan_loss_pct WAN packet loss rssi_dbm Wi-Fi signal
  3. Where does that file go? If you set WTFI_HISTORY, that path wins. Otherwise it goes under your XDG state home, and when that isn't set, under .local/state in your home folder, on macOS too. The file looks after itself. Past 4 MiB, it cuts back to its newer half, and a line that a killed process left half-written costs only that one line.

    Slide text
    wtfi2 v0.7.0
    --record history.jsonl --history -w --record opt-in

    The history file lives in your state directory

    $WTFI_HISTORY
    if it is set, this path wins
    otherwise
    $XDG_STATE_HOME/wtfi/history.jsonl
    otherwise
    ~/.local/state/wtfi/history.jsonl
    macOS included
    4 MiB

    Past this size, the file keeps its newer half.

    A half-written line costs only itself.

  4. The second flag reads the file back. On a fresh machine, history tells you how to start, and exits cleanly. Once you've recorded, it prints your last 20 sweeps, one row each: the time in UTC, the status, where the path broke, gateway and WAN latency, signal, and the headline. A tally of ok, warn and fail closes the list. Pass a number for more rows, or add json for scripts.

    Slide text
    wtfi2 v0.7.0
    --record history.jsonl --history -w --record opt-in

    wtfi --history prints your recent sweeps

    $ wtfi --history
    No recorded sweeps yet. Run `wtfi --record` (or `wtfi -w --record`) to start.
    one row per sweep, newest 20 by default
    time (UTC) · status · first break · gw · wan · signal · headline
    3 sweeps · 2 ok · 0 warn · 1 fail
    --history 100 --history --json
  5. Record also works with the live dashboard. In a fresh session, the gateway and WAN sparklines start nearly empty, like here. Start the dashboard with record, and they start from your last recorded sweeps instead. Each new sweep is written once, from a background thread, so file writes stay off the dashboard's drawing loop.

    Slide text
    wtfi2 v0.7.0
    --record history.jsonl --history -w --record opt-in

    wtfi -w --record starts its sparklines from your last sweeps

    Each new sweep is written once, from a background thread, off the dashboard's drawing loop.

  6. Recording is opt-in. A plain run diagnoses and prints as before, and records nothing. Add record, and you get the same report plus one line in the history file. History refuses to combine with the dashboard or with record. Its times print in UTC, since local time would need a time zone database. And if wtfi can't work out where the file goes, it warns and skips recording.

    Slide text
    wtfi2 v0.7.0
    --record history.jsonl --history -w --record opt-in

    Recording stays off until you ask for it

    $ wtfi

    Diagnoses and prints, as before. Nothing is recorded.

    $ wtfi --record

    The same report, plus one line in history.jsonl.

    --history refuses -w and --record

    Timestamps print in UTC

  7. Here's how to get it. Use Homebrew, the install script on the release page, or cargo, which needs Rust 1.88 or newer. Prebuilt binaries cover Apple Silicon and Intel Macs, and x64 and ARM64 Linux. Then add record to the runs you care about. Your history starts empty, so the first graphs are short. After a few days of recording, yesterday's dead zone stays on the graph.

    Slide text

    Install 0.7.0, then add --record to the runs you care about

    $ brew install kanywst/tap/wtfi2
    $ curl --proto '=https' --tlsv1.2 -LsSf \
      https://github.com/kanywst/wtfi2/releases/download/v0.7.0/wtfi2-installer.sh | sh
    $ cargo install wtfi2  # Rust 1.88+

    Prebuilt for Apple Silicon and Intel macOS, x64 and ARM64 Linux

    github.com/kanywst/wtfi2/releases/tag/v0.7.0

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built in New York with ❤️