Skip to content

IGNITE-29011 SQL: Add result set size metrics for queries - #13517

Closed
alex-plekhanov wants to merge 5 commits into
apache:masterfrom
alex-plekhanov:ignite-29011
Closed

IGNITE-29011 SQL: Add result set size metrics for queries#13517
alex-plekhanov wants to merge 5 commits into
apache:masterfrom
alex-plekhanov:ignite-29011

Conversation

@alex-plekhanov

Copy link
Copy Markdown
Contributor

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see tab PR Check at TC.Bot - Instance 1 or TC.Bot - Instance 2)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

@zstan zstan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I fill some Nit comments plz check them

assertEquals(0, values[i]);

// Verify max value on the initiating node.
assertEquals(500L, resultSetSizeMax(initNode).value());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably it`s better to use constant here just for test clarification ?
and constant here:
for (int limit : new int[] {0, 1, 5, 50, 500 <-- change for constant ? })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Constant for range or constant for each value? I think both is redundant.


/** */
IgniteH2Indexing h2() {
return h2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need 'whole' IgniteH2Indexing access here ? I think better give only necessary i.e. : return h2.runningQueryManager();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But it looks not very consistent, runing query manager is not relied to reduce executor, but reduce executor is a part of indexing, so it's more correct to bind these two components.

"on this node. This metric number included in the general 'failed' metric.");

resultSetSizeHistogram = userMetrics.histogram("resultSetSizeHistogram",
new long[] {0, 1, 10, 100, 1_000, 10_000, 100_000, 1_000_000},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we also give a Billion here ? In distributed huge cluster it`s normal i think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fetching more than million entries for sql query it's not normal even if cluster contains billions (I think it's even not ok to fetch more than 1000 entries).
All fetches with more than million entries go to last bucket, so they will not be missed.
Buckets are tunable, if someone think that it's ok to fetch million entries but not ok to fetch billion entries, it can be configured.

assertEquals(500L, resultSetSizeMax(initNode).value());

// Verify all other server nodes have zero metrics.
for (int i = 1; i < nodeCount(); i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

= 1 rely on GridAbstractTest#startGrids i`d prefer to filter by node name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure I get you right, but fixed something

/**
* Tests for result set size histogram and max result set size metrics.
*/
public class ResultSetSizeMetricsTest extends AbstractMultiEngineIntegrationTest {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see SqlDiagnosticIntegrationTest probably it about diagnostic too ? I don`t know here ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SqlDiagnosticIntegrationTest - is about Calcite only engine. The new test uses both engines.

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.

2 participants