-
Notifications
You must be signed in to change notification settings - Fork 292
Add "--max-cache-duration" option to the Recorder to facilitate the time bounded snapshot feature #2289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MichaelOrlov
wants to merge
18
commits into
rolling
Choose a base branch
from
morlov/add-max-cache-duration-option
base: rolling
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
- Added the "--snapshot-duration" CLI option. Default value 0 indicates that the snapshot will be limited by the --max-cache-size parameter only. If the value is more than 0, the cyclic buffer for the snapshot will be limited by both the series of messages duration and the maximum cache size parameter. - To override the upper bound by total messages size, the "--maximum-cache-size" CLI option can be settled to 0. Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
- Add ability to limit MessageCacheBuffer by duration in addition to the limit by the buffer size. Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
- Rationale: 1. On practice there are no value to have cache in a fraction of seconds we can always limit by size as well. 2. It is much easier to operate with a plain integer type rather than rclcpp::Duration. 3. It would be good to avoid dependencies from the rclcpp layer in the StorageOptions data struct. Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
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.
Description
This PR adds the ability to limit the inner Recorder cache not only by size, but also by duration in seconds.
This is a more generic alternative to the "--snapshot-duration" CLI option implemented in the #1844
Originally, the implementation was planed to be made only for the
snapshot modeto be used as a time bounded snapshot feature. However, it was generalized and the same "--max-cache-duration" CLI option can be used as a cache limiter for the regular recording.Note: The max-cache-duration it is set to 0 by default for backward compatability behavior. i.e. only
--max-cache-sizecache limiter will be applied by default.Is this user-facing behavior change?
Yes, a new "--max-cache-duration" CLI option was added
Did you use Generative AI?
Yes. GitHub Copilot, GPT-5 was used to help with unit tests and Doxygen comments.
Additional Information
This PR is not backportable, because it has API/ABI breaking changes.