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

Explore: Avoid reinitializing graph on every query run #77281

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

Elfo404
Copy link
Member

@Elfo404 Elfo404 commented Oct 27, 2023

What is this feature?

Fixes the structureRev logic in explore so that the first result is not 0, which would cause the graph to re-init at every render.

Why do we need this feature?

1 - improves performance as no initialization is done if not needed
2 - having it to 0 would cause the graph to re-init at every render, due to some timing issues with changing queries and zooming, thous would break explore. see #77237 for details

Who is this feature for?

Explore users

Which issue(s) does this PR fix?:

Fixes #77237

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

Copy link
Contributor

@gtk-grafana gtk-grafana left a comment

Choose a reason for hiding this comment

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

Nothing like a single char PR! Works good for me locally, thanks for finding the fix for this so quickly!

@github-actions
Copy link
Contributor

Backend code coverage report for PR #77281
No changes

@github-actions
Copy link
Contributor

Frontend code coverage report for PR #77281

Plugin Main PR Difference
explore 85.33% 85.33% 0%

@Elfo404 Elfo404 merged commit bf554d1 into main Oct 27, 2023
32 checks passed
@Elfo404 Elfo404 deleted the gio/fix/initial-structure-rev branch October 27, 2023 13:37
grafana-delivery-bot bot pushed a commit that referenced this pull request Oct 27, 2023
@grafana-delivery-bot
Copy link
Contributor

The backport to v10.2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-77281-to-v10.2.x origin/v10.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x bf554d121cc116457f3432f2448314381b234016

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-77281-to-v10.2.x
# Create the PR body template
PR_BODY=$(gh pr view 77281 --json body --template 'Backport bf554d121cc116457f3432f2448314381b234016 from #77281{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.2.x] Explore: Avoid reinitializing graph on every query run" --body-file - --label "type/bug" --label "area/explore" --label "area/frontend" --label "add to changelog" --label "backport" --base v10.2.x --milestone 10.2.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-77281-to-v10.2.x

# Create a pull request where the `base` branch is `v10.2.x` and the `compare`/`head` branch is `backport-77281-to-v10.2.x`.

# Remove the local backport branch
git switch main
git branch -D backport-77281-to-v10.2.x

@grafana-delivery-bot grafana-delivery-bot bot added the backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. label Oct 27, 2023
Elfo404 added a commit that referenced this pull request Oct 30, 2023
)

Explore: Avoid reinitializing graph on every query run (#77281)

(cherry picked from commit bf554d1)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
ssama88 pushed a commit to ssama88/grafana that referenced this pull request Oct 31, 2023
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/explore area/frontend backport v10.2.x backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore: Drag zoom breaking after number of series changes
3 participants