-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/cs/processor refactor #131
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
This pull request refactors several aggregator processors and processing handlers to improve performance, readability, and overall maintainability. Key changes include the implementation of reset() on the Aggregator trait, removal of the format_num crate in favor of native formatting functions, and enhancements to progress indicators during long-running match processes.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/util/aggregators/sum.rs | Refactored to use native formatting and added a reset() method. |
| src/util/aggregators/none.rs | Added a no-op reset() method for the disabled aggregator. |
| src/util/aggregators/mean.rs | Updated aggregator to use native formatting and added reset(). |
| src/util/aggregators/date.rs | Refactored to cache parsed format and lazily compute rate. |
| src/util/aggregators/counter.rs | Simplified internal state, replaced ordering logic, and refactored constructor APIs. |
| src/util/aggregators/aggregator.rs | Introduced native formatting functions replacing format_num. |
| src/extensions/parser.rs | Updated aggregator construction for mode aggregation. |
| src/communication/handlers/* | Added progress indicator updates and minor refactoring. |
| Cargo.toml | Removed the dependency on the format_num crate. |
Comments suppressed due to low confidence (2)
src/util/aggregators/aggregator.rs:60
- The doc comment for 'format_int' is misleading as it still refers to formatting a float. Consider updating it to accurately describe that it formats an integer.
/// Formats a float as a string with commas separating thousands
src/util/aggregators/counter.rs:51
- [nitpick] The method name 'mean' for constructing a Counter for mode aggregation may be confusing given the existence of a 'Mean' aggregator. Consider renaming it to something more descriptive such as 'with_single_mode' or 'for_mode_aggregation'.
pub fn mean() -> Counter {
reset()onProcessorMethodstraitDateprocessordetermine_rate()lazily instead of onupdate()HashMapprocess_matches()jobsformat_numcrateformat_numcrate compiles a regex on every format call, taking up > 90% of app runtime:Click to expand flamegraphs
Before: