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

consume query level cpu and memory usage in query insights #13739

Conversation

ansjcy
Copy link
Member

@ansjcy ansjcy commented May 17, 2024

Description

This is a follow up on https://github.com/opensearch-project/OpenSearch/pull/13172/files#diff-916410426108bbd0b06952c34490ca05c7a2a78c1c10f7af28e88ead23a70f24 to consume query level cpu and memory usage in query insights

Related Issues

#12399

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • API changes companion pull request created.
  • 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 80c4615: 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?

@ansjcy ansjcy force-pushed the consume-resource-usages-in-query-insights branch from 80c4615 to 02bb39e Compare May 30, 2024 22:32
Copy link
Contributor

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

@deshsidd
Copy link
Contributor

deshsidd commented Jun 3, 2024

Looks good to me overall. Some minor comments and changelog also needed.

Copy link
Collaborator

@jainankitk jainankitk left a comment

Choose a reason for hiding this comment

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

Minor comments to improve the readability of the code!

@ansjcy ansjcy force-pushed the consume-resource-usages-in-query-insights branch from 02bb39e to 14294b1 Compare June 4, 2024 22:58
Copy link
Contributor

github-actions bot commented Jun 4, 2024

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

@ansjcy ansjcy force-pushed the consume-resource-usages-in-query-insights branch from 2d19224 to fa2c127 Compare June 7, 2024 18:36
Copy link
Contributor

github-actions bot commented Jun 7, 2024

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

@deshsidd
Copy link
Contributor

deshsidd commented Jun 7, 2024

Thanks for the refactoring! LGTM

Copy link
Contributor

github-actions bot commented Jun 7, 2024

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

@ansjcy ansjcy force-pushed the consume-resource-usages-in-query-insights branch from fa2c127 to 46669df Compare June 7, 2024 19:55
Copy link
Contributor

github-actions bot commented Jun 7, 2024

❌ Gradle check result for 46669df:

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?

Copy link
Contributor

github-actions bot commented Jun 7, 2024

❌ Gradle check result for fa2c127:

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?

ansjcy added 3 commits June 10, 2024 09:36
Signed-off-by: Chenyang Ji <cyji@amazon.com>
Signed-off-by: Chenyang Ji <cyji@amazon.com>
Signed-off-by: Chenyang Ji <cyji@amazon.com>
@ansjcy ansjcy force-pushed the consume-resource-usages-in-query-insights branch from 46669df to 0ccd62d Compare June 10, 2024 16:37
Copy link
Contributor

✅ Gradle check result for 0ccd62d: SUCCESS

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 67.30769% with 34 lines in your changes missing coverage. Please review.

Project coverage is 71.66%. Comparing base (b15cb0c) to head (0ccd62d).
Report is 385 commits behind head on main.

Files Patch % Lines
.../insights/core/listener/QueryInsightsListener.java 69.23% 10 Missing and 2 partials ⚠️
...in/insights/core/service/QueryInsightsService.java 50.00% 8 Missing and 4 partials ⚠️
...ansport/top_queries/TransportTopQueriesAction.java 20.00% 7 Missing and 1 partial ⚠️
...lugin/insights/core/service/TopQueriesService.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13739      +/-   ##
============================================
+ Coverage     71.42%   71.66%   +0.24%     
- Complexity    59978    61670    +1692     
============================================
  Files          4985     5091     +106     
  Lines        282275   289543    +7268     
  Branches      40946    41864     +918     
============================================
+ Hits         201603   207495    +5892     
- Misses        63999    64967     +968     
- Partials      16673    17081     +408     

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

@jed326 jed326 merged commit 04a417a into opensearch-project:main Jun 10, 2024
29 of 30 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-13739-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 04a417a7328ef7d4c501508703898ff2b477f302
# Push it to GitHub
git push --set-upstream origin backport/backport-13739-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-13739-to-2.x.

ansjcy added a commit to ansjcy/OpenSearch that referenced this pull request Jun 10, 2024
…h-project#13739)

* consume query level cpu and memory usage in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* handle failed requests metrics in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* refactor the code to make it more maintainable

Signed-off-by: Chenyang Ji <cyji@amazon.com>

---------

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit 04a417a)
ansjcy added a commit to ansjcy/OpenSearch that referenced this pull request Jun 10, 2024
…h-project#13739)

* consume query level cpu and memory usage in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* handle failed requests metrics in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* refactor the code to make it more maintainable

Signed-off-by: Chenyang Ji <cyji@amazon.com>

---------

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit 04a417a)
jed326 pushed a commit that referenced this pull request Jun 10, 2024
…s tracking (#14085)

* Query-level resource usages tracking (#13172)

* Query-level resource usages tracking

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* Moving TaskResourceTrackingService to clusterService

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* use shard response header to piggyback task resource usages

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* split changes for query insights plugin

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* improve the supplier logic and other misc items

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* track resource usage for failed requests

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* move resource usages interactions into TaskResourceTrackingService

Signed-off-by: Chenyang Ji <cyji@amazon.com>

---------

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit 3d1fa98)

* fix concurrent modification issue in thread context (#14084)

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit c8f0b6d)

* consume query level cpu and memory usage in query insights (#13739)

* consume query level cpu and memory usage in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* handle failed requests metrics in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* refactor the code to make it more maintainable

Signed-off-by: Chenyang Ji <cyji@amazon.com>

---------

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit 04a417a)

* fix japicmp check for threadContext

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit b403fdc)
kkewwei pushed a commit to kkewwei/OpenSearch that referenced this pull request Jul 24, 2024
…s tracking (opensearch-project#14085)

* Query-level resource usages tracking (opensearch-project#13172)

* Query-level resource usages tracking

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* Moving TaskResourceTrackingService to clusterService

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* use shard response header to piggyback task resource usages

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* split changes for query insights plugin

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* improve the supplier logic and other misc items

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* track resource usage for failed requests

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* move resource usages interactions into TaskResourceTrackingService

Signed-off-by: Chenyang Ji <cyji@amazon.com>

---------

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit 3d1fa98)

* fix concurrent modification issue in thread context (opensearch-project#14084)

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit c8f0b6d)

* consume query level cpu and memory usage in query insights (opensearch-project#13739)

* consume query level cpu and memory usage in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* handle failed requests metrics in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* refactor the code to make it more maintainable

Signed-off-by: Chenyang Ji <cyji@amazon.com>

---------

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit 04a417a)

* fix japicmp check for threadContext

Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit b403fdc)
Signed-off-by: kkewwei <kkewwei@163.com>
wdongyu pushed a commit to wdongyu/OpenSearch that referenced this pull request Aug 22, 2024
…h-project#13739)

* consume query level cpu and memory usage in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* handle failed requests metrics in query insights

Signed-off-by: Chenyang Ji <cyji@amazon.com>

* refactor the code to make it more maintainable

Signed-off-by: Chenyang Ji <cyji@amazon.com>

---------

Signed-off-by: Chenyang Ji <cyji@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed v2.15.0 Issues and PRs related to version 2.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants