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

SQL: XPack FeatureSet functionality #35725

Merged
merged 20 commits into from Nov 26, 2018
Merged

Conversation

astefan
Copy link
Contributor

@astefan astefan commented Nov 20, 2018

This PR covers the requests in #34821.
At the moment is still work in progress. Missing bits: failed queries metrics counters and REST requests differentiation between cli, native rest requests and other clients.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

The biggest issue with the current PR is that the hook is applied in a destructive fashion.
Instead of adding overloaded method types (which means different code paths), a dedicated rule should be used instead.

@astefan astefan removed the WIP label Nov 21, 2018
@astefan
Copy link
Contributor Author

astefan commented Nov 22, 2018

@costin thank you for your review. I've made changes and pushed a new version.

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

Left some comments, thx!

return builder;
}

public static class Node extends BaseNodeResponse implements ToXContentObject {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rename it to something like NodeSqlStats

Copy link
Member

Choose a reason for hiding this comment

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

+1, we already have a Node inside the code base. NodeStats, NodeSqlStats etc...

Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename this.

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

The parsing can be simplified to avoid using maps through a simple, cheap bitset. Also the way the metric is passed around needs improvement.

@astefan
Copy link
Contributor Author

astefan commented Nov 22, 2018

@costin @matriv pushed a new commit.

@astefan
Copy link
Contributor Author

astefan commented Nov 23, 2018

@matriv @costin I've pushed another change, hopefully complete now. I've removed the duplicate counting of metrics logic altogether and fixed the bug in the SqlSession that was triggering it (thanks @costin for the pointer), more polishing and cosmetic changes and also I've added unit testing for Metrics and more integration tests.

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for incorporating the feedback.
I've left some minor comments regarding style, nothing major.
There's the discussion of breaking the stats into queries/paging and each one total/failed/successful but if it's easier for you, that can be addressed in a follow-up PR.

return mode;
}

public void mode(Mode mode) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this setter ever used? why not always use the constructor?

return clientId;
}

public void clientId(String clientId) {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, why setter?

return builder;
}

public static class Node extends BaseNodeResponse implements ToXContentObject {
Copy link
Member

Choose a reason for hiding this comment

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

+1, we already have a Node inside the code base. NodeStats, NodeSqlStats etc...

import static org.elasticsearch.xpack.sql.stats.FeatureMetric.WHERE;
import static org.elasticsearch.xpack.sql.stats.Metrics.FPREFIX;

public class VerifierMetricsTests extends ESTestCase {
Copy link
Member

Choose a reason for hiding this comment

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

👍

*/
public class Metrics {
private enum OperationType {
FAILED, PAGING, TOTAL;
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be broken into QUERY/PAGING each one with FAILED/SUCCESSFUL/TOTAL

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

LGTM. Great stuff! left some minor comments.

return builder;
}

public static class Node extends BaseNodeResponse implements ToXContentObject {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename this.

@astefan
Copy link
Contributor Author

astefan commented Nov 23, 2018

run the gradle build tests 1

@astefan astefan merged commit 00e6fec into elastic:master Nov 26, 2018
astefan added a commit to astefan/elasticsearch that referenced this pull request Nov 26, 2018
* Introduced "client.id" parameter for REST requests
* Bug that made the Verifier run twice, fixed in the Analyzer
* Single node IT and unit testing
astefan added a commit to astefan/elasticsearch that referenced this pull request Nov 26, 2018
astefan added a commit that referenced this pull request Nov 26, 2018
* Introduced "client.id" parameter for REST requests
* Bug that made the Verifier run twice, fixed in the Analyzer
* Single node IT and unit testing
@astefan astefan deleted the 34821_feature branch November 27, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants