Skip to content

Conversation

@pado0
Copy link
Contributor

@pado0 pado0 commented Oct 31, 2025

Description

This PR refactors the RemoteTranslogTransferTracker.Stats and RemoteSegmentTransferTracker.Stats 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 RemoteTranslogTransferTracker.Stats and RemoteSegmentTransferTracker.Stats 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.

@pado0 pado0 force-pushed the builder-remote-transfer-tracker branch from e85aa3e to 96ffd50 Compare October 31, 2025 05:17
@github-actions
Copy link
Contributor

✅ Gradle check result for 96ffd50: SUCCESS

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.06%. Comparing base (6b35c7c) to head (d48903a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19837      +/-   ##
============================================
- Coverage     73.08%   73.06%   -0.03%     
+ Complexity    71063    71042      -21     
============================================
  Files          5754     5754              
  Lines        325262   325437     +175     
  Branches      47033    47033              
============================================
+ Hits         237732   237791      +59     
- Misses        68380    68542     +162     
+ Partials      19150    19104      -46     

☔ 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.

Copy link
Member

@sandeshkr419 sandeshkr419 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for refactoring this - let's just fix the version in comments.

@pado0 pado0 force-pushed the builder-remote-transfer-tracker branch from ce6cdab to d48903a Compare November 1, 2025 16:23
@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

✅ Gradle check result for d48903a: SUCCESS

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