Skip to content

Conversation

@pado0
Copy link
Contributor

@pado0 pado0 commented Nov 8, 2025

Description

This PR refactors the GetStats, FlushStats and QueryCacheStats 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 GetStats, FlushStats and QueryCacheStats 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 closed this Nov 8, 2025
@pado0 pado0 reopened this Nov 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

❌ Gradle check result for 019fcfc: 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?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

❌ Gradle check result for 019fcfc: 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 requested review from a team, shwetathareja and sohami as code owners November 9, 2025 16:31
@pado0 pado0 reopened this Nov 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

❌ Gradle check result for 019fcfc: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for e25aa9f: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for 69c515f: 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?

@github-actions
Copy link
Contributor

✅ Gradle check result for 69c515f: 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.26%. Comparing base (4dc8704) to head (69c515f).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #19935   +/-   ##
=========================================
  Coverage     73.25%   73.26%           
+ Complexity    71555    71550    -5     
=========================================
  Files          5785     5785           
  Lines        326828   326907   +79     
  Branches      47295    47295           
=========================================
+ Hits         239429   239495   +66     
+ Misses        68163    68157    -6     
- Partials      19236    19255   +19     

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

@sandeshkr419 sandeshkr419 merged commit 5dc0417 into opensearch-project:main Nov 11, 2025
34 of 36 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