Convert FOM extract to strategy pattern [AI] - #1727
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the analysis logic in Ramble by introducing a strategy pattern. It extracts the analysis code from the application base class into a new ramble.analysis package, implementing both the original ForwardAnalysisStrategy and a new, optimized BackwardsAnalysisStrategy that reads log files backwards to allow early termination. Unit tests are also added to verify these strategies. The review feedback highlights a bug in the backwards file reader where leading empty lines could be ignored, and points out potential runtime errors in BackwardsAnalysisStrategy due to missing local imports of ramble.analysis in fallback blocks.
Ramble Performance Test MetricsResults produced with commit: 82e734e
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1727 +/- ##
===========================================
+ Coverage 93.94% 93.96% +0.01%
===========================================
Files 367 372 +5
Lines 36605 36906 +301
===========================================
+ Hits 34389 34678 +289
- Misses 2216 2228 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Bob <robertbird@google.com>
Signed-off-by: Bob <robertbird@google.com>
Signed-off-by: Bob <robertbird@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Bob <robertbird@google.com>
Signed-off-by: Bob <robertbird@google.com>
This is some nice OOP around fom extraction, that allows for different methods of extraction
In some situations (such as no contexts) this allows us to have an optimized extract that swap out the full scan "forward last wins" and instead read the file backwards and stop early