Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

Improve TUI and latency calculations - #83

Merged
geonnave merged 6 commits into
DotBots:mainfrom
geonnave:latency-stamping-fix
May 18, 2026
Merged

geonnave merged 6 commits into
DotBots:mainfrom
geonnave:latency-stamping-fix

Conversation

@geonnave

Copy link
Copy Markdown
Contributor

Description

Make latency more accurate at python side, a bunch of TUI improvements.


Testing of Node / Gateway (if applicable)

  • I tested this change with _1_ nodes and _1_ gateways.
  • I let it run for the following amount of time: _10_ minutes

geonnave added 6 commits May 17, 2026 21:35
Replace time.time() with time.monotonic_ns()//1000 (NTP-safe), capture
edge_tx_ts_us inside serial.lock just before write, capture
edge_rx_ts_us when HDLC payload becomes READY on the RX thread.
Removes mari.lock contention and clock-step noise from measured RTT.

AI-assisted: Claude Opus 4.7
Probes already carry gw_tx_enqueued_asn / node_rx_asn /
node_tx_enqueued_asn / gw_rx_asn — convert to ms via the 1.7240 ms
slot duration and display the host/dl/app/ul breakdown alongside the
total RTT in one cell. Add a 'TX queue (sf)' column showing
ul_ms / sf_duration as a slotframe-deep queue estimate, with a header
⚠ warning when any node's queue exceeds the threshold. See
docs/mari-protocol-summary.md for the path decomposition.

AI-assisted: Claude Opus 4.7
…lper

Match the bold-yellow style of the Latency and Stats labels for PDR so
the three metric labels look consistent. Insert the missing space
before 'ms' in the latency average. Normalize trailing-space and
separator inconsistencies in the Stats line. Drop the unused
MariNode.stats_uplink_utilization helper added during prototyping.

AI-assisted: Claude Opus 4.7
Short column headers stay short ('Q (sf)' rather than 'TX queue
(sf)'); the meaning of each latency leg and the queue-depth coloring
goes in a 'Reading the TUI' README section instead.

AI-assisted: Claude Opus 4.7
CI's ruff check rejected a module-level import that came after the
constants; reorder so all imports stay at the top.

AI-assisted: Claude Opus 4.7
Replace the 1/20/1 wire-layout literals with sums over Header()
and HeaderStats() metadata, so the offset survives any reordering
of the Mari header layout (today both still compute to 20 and 1).
Only the leading EdgeEvent prefix byte stays a literal. Also carries
the prior hatch fmt pass over the touched files.

AI-assisted: Claude Opus 4.7
@geonnave
geonnave force-pushed the latency-stamping-fix branch from 5e2bdc0 to 4ef1e1a Compare May 18, 2026 10:01
@geonnave
geonnave merged commit 8343bfa into DotBots:main May 18, 2026
6 checks passed
@geonnave
geonnave deleted the latency-stamping-fix branch May 18, 2026 10:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant