Repository navigation
feat(dashboard): the dashboard's and the GPS's history is kept across restarts - #387
Merged
Merged
Conversation
… restarts The counters behind the Dashboard and the GPS statistics were only in memory, so a restart, an update or a crash emptied them. They're now saved to dashboard-history.json in the data folder every 5 minutes and as the engine stops, and taken up at start for whatever is under 24 hours old. Down time shows as empty points; a damaged file is set aside.
As the other generated serializer contexts are: it isn't code anyone wrote, and it pulled branch coverage under the gate.
gx1400
force-pushed
the
feat/history-file
branch
from
October 26, 2026 10:18
fc18fcf to
33a82d2
Compare
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.
Closes #386. The bottom of tonight's stack.
The Dashboard's counters (F1.22) and the GPS statistics (F3.14) were memory-only, so a restart, an update or a crash emptied them. As you chose, they're now kept in a file; SQLite can take its place later.
dashboard-history.jsonin the data folder (on the gateway, its data volume). It's a versioned JSONHistorySnapshotbehind an internalIHistoryStore, so a SQLite store can replaceFileHistoryStorewithout touching the dashboard.EngineOptions.HistorySaveInterval), as the engine stops, and right after Clear packets, so a restart doesn't bring the cleared counts back. Each save writes.tmpand renames it over the old file.DashboardCountersandGpsHistorygainExport/Import. Enum values are stored by name, so reordering an enum can't misread an old file. That covers the minute buckets, the distinct-station rings, per-station tallies (so My view still works), relays, sources, the newest stations, and the GPS minutes, outages and wander origin. A 24-hour file is a few hundred KB at most..invalid, and counting starts afresh with a log warning.EngineOptions.HistoryFileis set only when the engine is added to a host, so tests that build the engine themselves keep history in memory.HostingTests.EnabledEngineStartsConnectingWithTheHostran the hosted engine on the real data folder and wrote a history file there during my first run. It now uses a temporary folder; I deleted the stray file and checked that a full run leaves nothing.Tests (
HistoryFileTests, 5):.tmp;