Skip to content
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

[Backport 2.x] Make search query counters dynamic to support all query types (#12601) #13397

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

deshsidd
Copy link
Contributor

(cherry picked from commit abe270f)

The change aims to make the search query counters dynamic to support all query types.

Description
Initially, we only incremented counters for a select few query types as part of #11596. Based on requests in the #5983, we want to cover ALL query types including the query types that might be included as part of plugin code.

To implement this, we create a map that stores the query builder name to Query type Counter. When we encounter a new query type we add the query to the map and create a new associated counter. We then use this counter to increment for all requests coming in for the aforementioned query type. This implementation ensures that we do not need to manually keep adding new Counters for new Query types and all future query types will be supported out of the box (including plugin query types).

Related Issues

Resolves #5983

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

Copy link
Contributor

✅ Gradle check result for b428615: SUCCESS

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.14%. Comparing base (0dd892c) to head (b428615).
Report is 186 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #13397      +/-   ##
============================================
- Coverage     71.28%   71.14%   -0.14%     
- Complexity    60145    60720     +575     
============================================
  Files          4957     5011      +54     
  Lines        282799   285831    +3032     
  Branches      41409    41785     +376     
============================================
+ Hits         201591   203359    +1768     
- Misses        64189    65304    +1115     
- Partials      17019    17168     +149     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sohami sohami merged commit 1b8cba3 into opensearch-project:2.x Apr 26, 2024
50 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.

3 participants