Repository navigation
refactor(metrics): consolidate UmiCountTracker and remove ALL_REJECTIONS duplication - #145
Conversation
…ONS duplication Replace three separate HashMaps in UmiCountTracker with a single HashMap<String, (usize, usize, usize)>, eliminating two redundant key clones per record() call and simplifying iteration. Replace the manually-maintained ALL_REJECTIONS array with an all_rejections() function that chains CORE_REJECTIONS and OPTIONAL_REJECTIONS iterators, removing the duplicated entries.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request refactors internal data structures in the metrics crate. The consensus module replaces a static ALL_REJECTIONS array with a private function that dynamically chains core and optional rejection arrays. The duplex module consolidates three separate per-UMI counter maps into a single map with tuple values. Both changes maintain existing public APIs while simplifying internal implementation and reducing code duplication. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
=======================================
Coverage 83.61% 83.61%
=======================================
Files 126 126
Lines 51510 51510
=======================================
Hits 43069 43069
Misses 8441 8441 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
UmiCountTrackerfrom 3 separate HashMaps (raw counts, error counts, unique counts) into a singleHashMap<String, (usize, usize, usize)>, eliminating redundant key cloning on eachrecord()callALL_REJECTIONSconst array (which manually listed CORE + OPTIONAL rejections) withall_rejections()function that chains the two source arraysTest plan
cargo nextest run -p fgumi-metrics— all tests passcargo ci-fmt— cleancargo ci-lint— clean