Skip to content
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

Improved search/parse filters; support search RIB dump files #70

Merged
merged 4 commits into from
Jan 8, 2025

Conversation

digizeph
Copy link
Member

This PR improves the implementation of filters for monocle parse and monocle search. It also adds support for searching data from RIB dump files.

This PR resolves the following issues: #68

Refactor filters implementation

  • Introduced filters and time modules for cleaner separation
  • Moved ParseFilters and SearchFilters implementations to filters
  • Centralized time-related logic into the time.rs module
  • Replaced redundant parser_with_filters function with traits in filters
  • Simplified dependencies in monocle.rs by leveraging modularized functions

Support search RIB dump files

  • added --dump_type argument for monocle search command:
    • updates: default, search updates files only
    • rib: search RIB dump files only
    • rib-updates: search both RIB dump and updates files
  • updated broker query to filter by selected dump type

For example, the following command searches RIB dump files that overlaps with the first hour of 2024 (GMT).

monocle search --start-ts 2024-01-01T00:00:00Z --duration 1h -c rrc00 --dump-type rib

- Introduced `filters` and `time` modules for cleaner separation
- Moved `ParseFilters` and `SearchFilters` implementations to `filters`
- Centralized time-related logic into the `time.rs` module
- Replaced redundant `parser_with_filters` function with traits in `filters`
- Simplified dependencies in `monocle.rs` by leveraging modularized functions
- Corrected article usage (e.g., 'a' to 'an') in multiple descriptions.
- Added missing commas in example clarifications (e.g., 'e.g., US').
- Improved phrasing for clarity (e.g., 'prefix-to-origin mapping').
- Adjusted minor formatting inconsistencies in comments and annotations.
- updated `parse_start_end_strings` to return `i64` instead of `String`.
- replaced `.to_rfc3339()` calls with `.timestamp()`.
- adjusted return values to reflect the new timestamp format.
- added `DumpType` enum with options for updates, rib, and both
- added `dump_type` field with `updates` as default
- updated broker query to filter by selected dump type
@shyamkkhadka
Copy link

Nice to see this feature implemented. May I know when are you releasing this feature? I am not into Rust programming. So I just want to use the feature.

@digizeph digizeph merged commit 262a1bd into main Jan 8, 2025
1 check passed
@digizeph digizeph deleted the feature/refactor_filters branch January 8, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants