Repository navigation
Rank nodes by 7-day availability, and keep their counts across restarts - #601
Merged
Merged
Conversation
Babissimo
force-pushed
the
node-availability
branch
from
September 24, 2026 12:50
9e62436 to
cfad44c
Compare
This comment has been minimized.
This comment has been minimized.
The leaderboard's uptime was the time since a node last registered with this process, which every reconnect, config change and startup reset, and which nothing persisted: after a deploy every node read the same few minutes. total_detections, the column the leaderboard ranks by, was not persisted either, so the ranking also restarted with every deploy. retina-analytics now measures availability, the share of the minutes this server was up in which a node delivered a frame, over 7 days and 24 hours. The server's side of that is a clock task marking each minute the process is up. It starts five minutes after boot, because nodes take a while to reconnect after a restart and those minutes are the server's, not theirs. The snapshot carries each node's metrics (its week of minutes, when it was first seen, and its running counts) and the server's minutes with them, restored over what startup priming registered. The leaderboard row publishes availability_7d in place of uptime_s, and the e2e spec asserts the new fields on the deployed API. Ticket: https://app.clickup.com/t/123zgec4k7v Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The five pages that showed a node's uptime (leaderboard, overview, node detail, network health, node management) show its 7-day availability instead. The node's own page adds the 24-hour figure and how much of the week the figure rests on, which for a new node, or in the first week after this ships, is less than the whole of it. The leaderboard sorts on it, with a node not yet measured last. The percentage rounds down, so a node that missed one minute in a week reads 99.9% rather than a perfect 100.0%. The knowledge base said reputation was based on uptime. It is not: it is judged on the heartbeat, agreement with ADS-B and trusted neighbours, and a plausible detection rate, which is what it now says. Availability gets its own entry. Ticket: https://app.clickup.com/t/123zgec4k7v Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Babissimo
force-pushed
the
node-availability
branch
from
September 24, 2026 13:03
cfad44c to
85d9ad1
Compare
|
Claude finished @Babissimo's task in 1m 56s —— View job Review of PR #601
I checked ReviewSolid, well-scoped change. The two-commit split (backend/library-facing, then dashboard) is clean, and the snapshot round-trip and clock-grace behavior are both exercised by real tests with controls, not just happy-path assertions. Correctness — verified
Minor / non-blocking (unchanged from the earlier pass)
Not independently reviewable from this checkout
Nothing here blocks merge. |
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.
Item 4 of the console split (ClickUp 123zgec4k7v, epic 123zgec4k7k). The leaderboard's uptime becomes 7-day availability, and a node's counts survive a restart.
Needs offworldlabs/retina-analytics#36. The submodule points at that PR's commit, which stays on retina-analytics
mainonce the PR is merge-committed, so this PR should merge after it.Why
Uptime was the time since a node last registered with this process, and every reconnect, config change and startup reset it. Nothing persisted it either, so after a deploy every node read the same few minutes: all online nodes showed "0h 4m" on production on 2026-09-23.
total_detections, the column the leaderboard ranks by, was not persisted, so the ranking also restarted with every deploy.What changes
Backend (first commit):
server_clock_taskmarks each minute this process is up, every 20 s. It starts five minutes after boot, so the minutes nodes spend reconnecting after a restart count for no one. On production's last restart (10:59:36 today), the frame rate was back to steady state within 40 s.first_seen, and the running counts including frames, so reputation's detections-per-frame reading stays sane) and the server's minutes. They are restored over what startup priming registered. This adds about 1.8 KB per node.PublicLeaderboardRow.uptime_sbecomesavailability_7d.e2e/specs/nodes.spec.tsasserts the new metrics fields on the deployed API in place ofuptime_s.Dashboard (second commit):
Choices you may want to overrule
Tests
pre-commit, dashboard and e2e typecheck, and lint are clean.uv lock --checkwith the Dockerfile's uv 0.12.5 is clean, so no relock is needed.🤖 Generated with Claude Code