Skip to content

Conversation

@pado0
Copy link
Contributor

@pado0 pado0 commented Nov 11, 2025

Description

This PR refactors the TranslogStats and RequestCacheStats class 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:

  1. Added a Builder and deprecated the existing constructors.
  2. Replaced usages of constructors in code and tests with the new Builder.

There are multiple stats-related classes that need similar refactoring, and we are addressing them in priority order. This PR covers TranslogStats and RequestCacheStats as part of that effort.

Related Issues

Related to #19225

Check List

  • Functionality includes testing.

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.

@github-actions
Copy link
Contributor

✅ Gradle check result for a09b7ef: SUCCESS

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.28%. Comparing base (2fddcd8) to head (30aecd9).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

❌ 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?

@github-actions
Copy link
Contributor

✅ Gradle check result for d6eea39: SUCCESS

@pado0 pado0 force-pushed the builder-translog-requestcache-stats branch from df1a02f to daf729f Compare November 13, 2025 06:24
@github-actions
Copy link
Contributor

❌ 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?

@pado0 pado0 force-pushed the builder-translog-requestcache-stats branch from cb3fa9a to ccf1db9 Compare November 13, 2025 16:01
@pado0 pado0 force-pushed the builder-translog-requestcache-stats branch from ccf1db9 to 30aecd9 Compare November 13, 2025 16:07
@github-actions
Copy link
Contributor

✅ Gradle check result for 30aecd9: SUCCESS

@sandeshkr419 sandeshkr419 merged commit e02b778 into opensearch-project:main Nov 13, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants