Repository navigation
fix(pool): the capacity history survives a coordinator restart - #373
Merged
Merged
Conversation
The coordinator keeps each node's history in history.json, written every minute and read when it starts, without what is older than the hour or the day. The capacity chart puts each point at its time and draws a gap as one, so a short history no longer stretches over the whole range.
Merged
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.
The coordinator kept the pool's capacity history only in memory (ADR-0036 point 2), so every update left the charts empty for an hour and incomplete for a day. The chart also spread whatever points it had over its full width, so half an hour of data looked like a full hour or day.
Review card
history.jsonin its directory and reads it when it starts; a restart loses a minute at most.machines.json), not with every report.Approved by the owner on 2026-10-29: all four points, and the chart's time axis in the same pull request.
Decided on my own: JSON like the coordinator's other files; no extra write on shutdown (the minute interval covers it); the chart puts each point at its time on the range it shows and draws runs separated by a gap (> 120 s for the hour, > 300 s for the day) apart.
Changes
coordinator.rs:Historyserialises;load_history/save_history; a task writes every minute; test for save, load, trimming and a broken file.PoolCapacityChart.vue: time axis, gaps, hover by time;lib/runs.tswith a test.docs/pool.md,docs/dashboard-api.md, CHANGELOG.Checked
cargo test -p devstack-node,cargo clippy,cargo fmtvue-tsc,vitest,npm run build