Repository navigation
fix(graphs): historical ranges (30 min … 30 d) draw their data - #3
Merged
Merged
Conversation
The chart instance is reused when the range changes, but its x window (15 min for Live) and gap handling were fixed at build time, so every historical range was drawn into the Live window and looked empty. The chart now rebuilds when switching between Live and historical ranges, and the x range follows the selected window. Also: after a restart the in-memory 1 s history is empty, so 30 min and 1 h now fill the older part of the range from the persisted 1-minute rollups; lines join across empty buckets on historical ranges, and isolated points are drawn as dots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159fEExV6P6AdgP7HbsJNBc
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.
On the Graphs tab only Live drew lines. 30 min, 1 h, 6 h, 24 h, 7 d and 30 d showed empty charts, with only the legend numbers filled in.
Cause
The chart is reused when you switch ranges, but two settings were fixed when it was first built in Live mode:
Every historical range was therefore drawn into a 15-minute window, so almost nothing was visible.
Fix
Chart.svelte:metrics.Query: the 1 s history lives in memory, so after a restart (for example an update) the 30 min and 1 h views only showed the minutes since the restart. They now fill the older part of the range from the persisted 1-minute rollups. Live stays pure 1 s data.Verification
TestQueryFillsRingGapFromRollups. It fails without the fix and passes with it.golangci-lintreports 0 issues,go test ./...passes, andnpm run checkis clean.🤖 Generated with Claude Code
https://claude.ai/code/session_0159fEExV6P6AdgP7HbsJNBc
Generated by Claude Code