Repository navigation
Conversation
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.
--bufferis au64of seconds, but it was converted withi64/chrono::Durationconversions that can fail, and the graph window arithmetic (started +/- display_interval,now - buffer) can leave chrono's representableDateTimerange. With a very large value, gping panicked while running (inPlotData::update) instead of reporting a bad argument.This change:
--bufferonce at startup (validate_buffer). A value that does not fitchrono::Duration, or whose windowstarted - buffer ..= started + bufferwould leave theDateTimerange, exits withInvalid buffer size: <n> seconds is out of range. The samestartedinstant is passed toAppso validation and use agree.PlotDataandAppnow take achrono::Durationinstead of converting au64themselves.PlotData::updatecomputes its retention cutoff withchecked_sub_signed. If the cutoff is not representable (for example the system clock moved backwards after startup), no point is treated as stale and all points are kept until a later reading makes it representable.Behavior changes to be aware of:
updateused to panic; it now keeps all points. If that state persisted, samples would keep accumulating, because there is no upper filter.Testing: 22 unit tests pass with
--lockedandcargo fmt --all --checkis clean; clippy with all targets and features shows no warnings. The newNonebranch test fails if the checked guard is reverted. I did not run the full workspace tests, release builds, the TUI on this exact revision, or a real system-clock rollback. The branch has two commits, so only the final tree builds.