-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add time filter option #87
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
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.
Pull Request Overview
Adds a new time-based filtering option to allow CLI consumers to restrict event processing by start/end timestamps or recent time offsets.
- Introduces
TimeOption
incli.rs
with new flags for--timeline-start
,--timeline-end
, and--time-offset
- Implements
filter_by_time
intimefiler.rs
and integrates it intoaws_summary
,aws_metrics
, andaws_detect
- Updates
main.rs
and module exports to wire the new filtering option through the existing commands
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/option/cli.rs | Define new TimeOption struct and CLI flags |
src/option/timefiler.rs | Implement time parsing and filtering logic |
src/option.rs | Export the new timefiler module |
src/main.rs | Update calls to aws_metrics and aws_summary to use TimeOption |
src/cmd/aws_summary.rs | Apply filter_by_time before summary processing |
src/cmd/aws_metrics.rs | Apply filter_by_time before metrics processing |
src/cmd/aws_detect.rs | Apply filter_by_time in detection pipeline |
Comments suppressed due to low confidence (2)
src/option/timefiler.rs:1
- [nitpick] The module and file are named
timefiler.rs
, but the feature is a time filter. Consider renaming totimefilter.rs
and the module totimefilter
for clarity.
use crate::option::cli::TimeOption;
src/option/timefiler.rs:44
- There’s no test case for invalid
time_offset
values (e.g., malformed strings). Add a test to ensurefilter_by_time
returns false whentime_offset
fails to parse.
fn parse_offset(offset: &str) -> Option<Duration> {
aws-ct-timeline --timeline-offset
|
aws-ct-summary --timeline-start
|
aws-ct-metrics --timeline-end
|
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.
@fukusuket LGTM! Thanks so much!
What Changed
aws-ct-timeline
time filtering #58Evidence
aws-ct-timeline
aws-ct-summary
aws-ct-metrics
I’d appreciate it if you could check it when you have time🙏