-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Refactor TranslogStats and RequestCacheStats with Builder pattern #19961
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
Refactor TranslogStats and RequestCacheStats with Builder pattern #19961
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19961 +/- ##
============================================
+ Coverage 73.25% 73.28% +0.02%
+ Complexity 71612 71563 -49
============================================
Files 5785 5785
Lines 326905 326960 +55
Branches 47280 47285 +5
============================================
+ Hits 239480 239597 +117
+ Misses 68220 68080 -140
- Partials 19205 19283 +78 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a09b7ef to
cad2c73
Compare
|
❌ Gradle check result for d6eea39: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
server/src/main/java/org/opensearch/index/translog/TranslogStats.java
Outdated
Show resolved
Hide resolved
df1a02f to
daf729f
Compare
|
❌ Gradle check result for daf729f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
cb3fa9a to
ccf1db9
Compare
Signed-off-by: Jean Kim <[email protected]>
Signed-off-by: Jean Kim <[email protected]>
Signed-off-by: Jean Kim <[email protected]>
Signed-off-by: Jean Kim <[email protected]>
Signed-off-by: Jean Kim <[email protected]>
ccf1db9 to
30aecd9
Compare
Description
This PR refactors the
TranslogStatsandRequestCacheStatsclass to use the Builder pattern instead of relying on multiple constructors.By adopting the Builder pattern, it becomes easier to evolve the stats API, add new metrics, and maintain backward compatibility without forcing disruptive constructor changes.
Based on the related issue:
There are multiple stats-related classes that need similar refactoring, and we are addressing them in priority order. This PR covers
TranslogStatsandRequestCacheStatsas part of that effort.Related Issues
Related to #19225
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.