-
Notifications
You must be signed in to change notification settings - Fork 182
feat: print average speed in forest-cli snapshot export #5869
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
Conversation
WalkthroughThe changes introduce a new feature to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~6 minutes ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CHANGELOG.md (1)
32-35: Place the entry under the “Added” header, not “Changed”.Printing a new metric is a feature addition; nothing existing was modified or broken. Move the bullet to the “Added” subsection to match the project’s own changelog guidelines.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)src/cli/subcommands/snapshot_cmd.rs(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: tests-release
- GitHub Check: tests
- GitHub Check: Build forest binaries on Linux AMD64
- GitHub Check: Build MacOS
- GitHub Check: Build Ubuntu
- GitHub Check: cargo-publish-dry-run
- GitHub Check: All lint checks
🔇 Additional comments (4)
src/cli/subcommands/snapshot_cmd.rs (4)
15-19: LGTM: Clean import additionsThe new imports for timing functionality (
Instant) and zero checking (num::Zero) are properly organized and necessary for the speed calculation feature.
98-98: LGTM: Proper timing initializationCapturing the start time with
Instant::now()at the beginning of the export process is the correct approach for measuring elapsed time.
103-103: LGTM: Reasonable interval adjustmentIncreasing the progress update interval from 0.25s to 0.5s reduces overhead while maintaining adequate user feedback for long-running snapshot exports.
115-126: LGTM: Well-implemented speed calculation with proper safety checksThe speed calculation logic is robust:
- Proper division-by-zero protection using
num::Zerotrait- Accurate elapsed time calculation with floating-point precision
- Consistent human-readable formatting for both file size and speed
- Clear output format showing progress and performance metrics
The implementation enhances user experience by providing real-time throughput feedback during long-running snapshot exports.
Summary of changes
(Originally part of #5867)
Changes introduced in this pull request:
forest-cli snapshot exportReference issue to close (if applicable)
Closes
Other information and links
Change checklist
Summary by CodeRabbit
New Features
Documentation