display connection stats in web UI#30
Merged
tridge merged 7 commits intoArduPilot:mainfrom May 9, 2026
Merged
Conversation
Contributor
tridge
commented
May 9, 2026
Adds a sidecar TDB written by each per-port-pair child whenever a connection appears or changes. The udpproxy parent recreates the file at startup and clears records for exiting / removed entries. Web admin and CLI tools read this to render who is currently connected. Snapshot is throttled (10s) and forked into a grandchild, mirroring the save_signing_timestamp pattern in mavlink.cpp so main_loop never blocks on disk I/O. New connections reset the throttle to 0 so the record appears on the next loop iteration without waiting a full tick. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Parses ConnEntry records using the same forward-compatible scheme as keydb_lib (>= MIN_SIZE accepted, trailing bytes preserved on read). Exposes iter_active() / list_active() with a 30s stale-record filter as defence in depth against orphans the parent failed to clean up. Used by webadmin/connections.py and the keydb.py stats command. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
New /admin/connections route lists every active connection across all entries (peer, transport, uptime, rx/tx). The owner /me/ page gains a per-entry section showing only that owner's own connections. Both pages auto-refresh every 10s via a meta refresh in the new head_extra block. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Loads the running build's hash from a git-version.txt file written into the repo by scripts/update_server.sh before rsync (.git/ itself is excluded from rsync, so reading the live hash on the server isn't viable). Falls back to live git rev-parse for local dev. The GitHub repo URL defaults to ArduPilot/UDPProxy and is overridable via webui.json's "github_repo" field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reads connections.tdb (sibling of keys.tdb) via conntdb_lib and prints one line per active connection, joined with the entry's name from keys.tdb. Convenient for quick on-server checks without loading the web UI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two related deploy fixes: - Capture the local 'git rev-parse --short HEAD' into git-version.txt before rsync so the deployed web UI can show the running commit in its footer (the .git directory itself is excluded from rsync). - pkill the webadmin gunicorn alongside udpproxy. start_proxy.sh skips relaunching gunicorn if one's already up, so without this step the new code is rsynced but the old worker keeps serving. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
keydb.py imports conntdb_lib at startup (for the new 'stats' command), so the runtime stage of docker/Dockerfile needs the file alongside keydb.py / keydb_lib.py. Without this the 'docker-test' CI job fails with ModuleNotFoundError on any keydb.py invocation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.