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

feat: #87 implemented rest endpoint to make stats available #90

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JohannesDaniel
Copy link

Description

As of now, LTRStats are collected, but not accessible via a REST endpoint. The feature is expected to return LTRStats as a map for URL path admin/ltr/stats.

Issues Resolved

#87

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

@jngz-es jngz-es left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -75,7 +76,7 @@ public String getLtrStoreHealthStatus(String storeName) {
clusterService.state().getRoutingTable().index(storeName)
);

return indexHealth.getStatus().name().toLowerCase();
return indexHealth.getStatus().name().toLowerCase(Locale.ROOT);
Copy link

@ylwu-amzn ylwu-amzn Dec 17, 2024

Choose a reason for hiding this comment

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

Not for this line.
Why do we use default locale here https://github.com/opensearch-project/opensearch-learning-to-rank-base/blob/main/src/main/java/com/o19s/es/termstat/TermStatQueryBuilder.java#L154-L155

        AggrType aggrType = AggrType.valueOf(aggr.toUpperCase(Locale.getDefault()));
        AggrType posAggrType = AggrType.valueOf(pos_aggr.toUpperCase(Locale.getDefault()));

@@ -75,7 +76,7 @@ public String getLtrStoreHealthStatus(String storeName) {
clusterService.state().getRoutingTable().index(storeName)
);

return indexHealth.getStatus().name().toLowerCase();
return indexHealth.getStatus().name().toLowerCase(Locale.getDefault());
}
Copy link
Author

Choose a reason for hiding this comment

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

Default as this is displayed

AggrType aggrType = AggrType.valueOf(aggr.toUpperCase(Locale.getDefault()));
AggrType posAggrType = AggrType.valueOf(pos_aggr.toUpperCase(Locale.getDefault()));
AggrType aggrType = AggrType.valueOf(aggr.toUpperCase(Locale.ROOT));
AggrType posAggrType = AggrType.valueOf(pos_aggr.toUpperCase(Locale.ROOT));

Copy link
Author

Choose a reason for hiding this comment

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

Root as this is used for logic

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.

4 participants