Repository navigation
refactor(consensus): remove dead code and improve efficiency in consensus commands - #154
Conversation
…nsus commands Remove ~115 lines of dead code from consensus_runner.rs (ConsensusResultTuple, ConsensusConfig, ConsensusExecutionContext). Replace tag_from_string with library string_to_tag in duplex_metrics.rs and hoist tag lookups before the template loop. Use ConsensusOutput::merge() instead of extend() in duplex.rs to avoid unnecessary copies. Remove unused test parameters and empty impl block in duplex_metrics.rs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
==========================================
+ Coverage 83.61% 83.64% +0.03%
==========================================
Files 126 126
Lines 51510 51342 -168
==========================================
- Hits 43069 42946 -123
+ Misses 8441 8396 -45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe changes refactor consensus and metrics handling across three modules. In consensus_runner.rs, public configuration and execution context structs are removed, replaced by a formalized ConsensusStatsOps trait defining merge and to_metrics methods. ConsensusCallingStats and CodecConsensusStats now implement this trait. The duplex.rs module updates ConsensusOutput's aggregation API from extend to merge, consuming owned input. The duplex_metrics.rs module consolidates tag resolution by replacing the tag_from_string helper with direct string_to_tag calls at the start of template processing, reducing redundant lookups. 🚥 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 |
Summary
consensus_runner.rs(ConsensusResultTuple,ConsensusConfig,ConsensusExecutionContextand associated unused imports)tag_from_stringwith librarystring_to_taginduplex_metrics.rsand hoist tag lookups before the template loop to avoid per-template recomputationConsensusOutput::merge()instead ofextend()induplex.rsto move data viaVec::appendrather than copying_mapq1/_mapq2test parameters and emptyimpl Interval {}block induplex_metrics.rsTest plan
cargo ci-test)cargo ci-fmt)cargo ci-lint)