-
Notifications
You must be signed in to change notification settings - Fork 715
fix: improve stream stats reset #8426
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
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Greptile Summary
This PR adds a configuration validation warning to the stream-stats reset command in the CLI module. When users run the stream statistics reset operation with calculate_stats_step_limit_secs set below 3600 seconds, the system now displays a prominent warning message suggesting they rerun the command with the recommended value of 3600 seconds.
The change is implemented in src/cli/basic/cli.rs within the existing reset command handler. The modification adds a simple configuration check that compares cfg.limit.calculate_stats_step_limit_secs against the 3600-second threshold and prints a formatted warning message when the value is too low. This warning appears before the actual reset operations (db::compact::stats::set_offset() and infra_file_list::reset_stream_stats()) execute, providing users with guidance while still allowing the operation to proceed.
This enhancement integrates well with the existing stream statistics infrastructure shown in the codebase context, particularly the stats.rs cache management system and the reset_stream_stats database function. The warning helps ensure users configure the system optimally for stream statistics calculations, which can be resource-intensive operations that benefit from appropriate time limits.
Confidence score: 5/5
- This PR is extremely safe to merge with virtually no risk of causing issues
- Score reflects the purely additive nature of the change - it only adds an informational warning without modifying core functionality
- No files require special attention as the change is a simple configuration check with console output
1 file reviewed, no comments
User description
Add some tips:
PR Type
Bug fix, Enhancement
Description
Add warning for low stats step limit
Guide to rerun with recommended env var
Improve stream-stats reset safety messaging
Diagram Walkthrough
File Walkthrough
cli.rs
Warn and guide when stats step limit too lowsrc/cli/basic/cli.rs
calculate_stats_step_limit_secs.