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: limiting the size of query results to Dashboard #3901

Merged
merged 8 commits into from
May 14, 2024

Conversation

poltao
Copy link
Contributor

@poltao poltao commented May 10, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

close #3716

What's changed and what's your intention?

Limit the returned rows to 1000, iff the query comes from Dashboard.

Adding a new source enum to the SqlQuery to identify if it's a request from DashBorad or not, and then handle the flow inside the src/servers/src/http/handler.rs:72. In addition, considering that the dashboard only supports greptimedb_v1 format, only the output of greptimedb_v1 format outputs is processed this PR.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@poltao poltao requested a review from a team as a code owner May 10, 2024 06:48
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 95.12195% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 85.50%. Comparing base (be1eb4e) to head (87c80ce).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3901      +/-   ##
==========================================
- Coverage   85.81%   85.50%   -0.31%     
==========================================
  Files         965      965              
  Lines      165015   165056      +41     
==========================================
- Hits       141602   141135     -467     
- Misses      23413    23921     +508     

src/servers/src/http/handler.rs Outdated Show resolved Hide resolved
src/servers/src/http/handler.rs Outdated Show resolved Hide resolved
src/servers/src/http.rs Outdated Show resolved Hide resolved
@poltao poltao force-pushed the limit-dashboard branch 2 times, most recently from 931c243 to 55cfd4c Compare May 11, 2024 12:08
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

We don't need to define the parse() method which is equivalent to from_str().ok().

src/servers/src/http.rs Outdated Show resolved Hide resolved
src/servers/src/http/handler.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

If we go forward in the limit param way, I don't think we should add the RequestSource option that would introduce tech debt.

src/servers/src/http.rs Outdated Show resolved Hide resolved
@poltao
Copy link
Contributor Author

poltao commented May 13, 2024

@MichaelScofield @zyy17 @tisonkun @evenyag PTAL: refactor PR by limit param.

Copy link
Collaborator

@tisonkun tisonkun 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 your contribution!

@MichaelScofield MichaelScofield added this pull request to the merge queue May 14, 2024
Merged via the queue into GreptimeTeam:main with commit 494ce65 May 14, 2024
21 checks passed
@poltao poltao deleted the limit-dashboard branch May 15, 2024 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limiting the size of query results to Dashboard
5 participants