-
Notifications
You must be signed in to change notification settings - Fork 67
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
Cluster config api return verbose PA status #342
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #342 +/- ##
============================================
+ Coverage 70.84% 70.88% +0.04%
- Complexity 373 377 +4
============================================
Files 44 44
Lines 2583 2597 +14
Branches 174 176 +2
============================================
+ Hits 1830 1841 +11
- Misses 641 647 +6
+ Partials 112 109 -3 ☔ View full report in Codecov by Sentry. |
...rch/performanceanalyzer/config/setting/handler/PerformanceAnalyzerClusterSettingHandler.java
Outdated
Show resolved
Hide resolved
...erformanceanalyzer/config/setting/handler/PerformanceAnalyzerClusterSettingHandlerTests.java
Outdated
Show resolved
Hide resolved
...erformanceanalyzer/config/setting/handler/PerformanceAnalyzerClusterSettingHandlerTests.java
Outdated
Show resolved
Hide resolved
...rch/performanceanalyzer/config/setting/handler/PerformanceAnalyzerClusterSettingHandler.java
Outdated
Show resolved
Hide resolved
As this is a breaking change(as api response is essentially changing), I think we should instead introduce a new parameter like We can just update the README for this param usage. @kiranprakash154 @dzane17 Thoughts?
|
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: David Zane <[email protected]>
Signed-off-by: David Zane <[email protected]>
0c3b6d3
to
a3efbd5
Compare
I have updated to only return detailed output when |
Overall LGTM. Just one minor comment. |
@@ -160,6 +160,7 @@ public List<ReplacedRoute> replacedRoutes() { | |||
@Override | |||
protected RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) | |||
throws IOException { | |||
request.param("verbose"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is required by the RestRequest class to mark "verbose" as a consumed parameter. Else it rejects all unknown params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right ie to mark it as a param this way. This is a way we fetch "verbose" param rather than mark it, isn't it?
Do you have any other such examples in existing PA codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment on L234 -
Lines 230 to 238 in 066cef8
String redirectEndpoint = request.param("redirectEndpoint"); | |
String urlScheme = isHttpsEnabled ? "https://" : "http://"; | |
String redirectBasePath = | |
urlScheme + "localhost:" + portNumber + RestConfig.PA_BASE_URI + "/"; | |
// Need to register all params in OpenSearch request else opensearch throws | |
// illegal_argument_exception | |
for (String key : request.params().keySet()) { | |
request.param(key); | |
} |
Yes, this method is primarily meant to fetch the value of the verbose
param which correspondingly marks it as "consumed." Since we do not care about the actual param value, there is no need to store the output of this call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Update the Description to check off the addition of Tests to your feature.
Would also be good to know why the JDK 11 and 17 builds are failing
* Cluster config api return verbose PA status Signed-off-by: David Zane <[email protected]> (cherry picked from commit 1f35eeb)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-342-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1f35eebbc9b25d46eb2b81463be7e2ba4e7bfc91
# Push it to GitHub
git push --set-upstream origin backport/backport-342-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x Then, create a pull request where the |
* Cluster config api return verbose PA status Signed-off-by: David Zane <[email protected]> (cherry picked from commit 1f35eeb)
* Cluster config api return verbose PA status Signed-off-by: David Zane <[email protected]> (cherry picked from commit 1f35eeb)
* Cluster config api return verbose PA status Signed-off-by: David Zane <[email protected]>
Signed-off-by: David Zane [email protected]
Is your feature request related to a problem? Please provide an existing Issue # , or describe.
Fixes #322
When checking cluster state of Performance Analyzer, the responses are bit-encoded numeric values, which don't provide much meaningful insight.
Current cluster/config output:
Describe the solution you are proposing
Translate bitmap to Map<String, Boolean> output when ?verbose query param is provided.
New cluster/config output:
Also works for these GET/POST APIs:
Describe alternatives you've considered
I have kept bitmap implementation instead of converting to some map object because of the provided Setting construct. We are using
Setting.intSetting()
. There is no map option (int, float, long, boolean... available).Also, int representation will help a bit with memory.
Additional context
Add any other context or screenshots about the feature request here.
Check List
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.