Feat/cs/processor refactor#131
Merged
Merged
Conversation
There was a problem hiding this comment.
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 {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: