-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: warn users of things that can make insights slow #28691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds functionality to warn users about slow-loading insights by detecting performance bottlenecks and providing targeted optimization suggestions.
- Added loading time tracking in
dataNodeLogic.ts
with thresholds at 7 and 12 seconds to trigger different levels of suggestions - Implemented
SlowQuerySuggestions
component inEmptyStates.tsx
to display actionable optimization tips based on query type - Added detection for slow query patterns (All events, First time for user, Strict funnel) in
insightDataLogic.tsx
- Created
SlowQueryPossibilities
type to standardize the categorization of slow query causes
💡 (3/5) Reply to the bot's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!
4 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
Size Change: 0 B Total Size: 1.2 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @rafaeelaudibert is going to revert this component.... but I do like this a lot more
I don't think he will revert the entire component, just the style changes he made, right? |
I can work around the new changes, I like them a lot. Let's merge this, and then I can work on reverting some (some being a keyword) of the styling changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -741,6 +751,20 @@ export const dataNodeLogic = kea<dataNodeLogicType>([ | |||
}, AUTOLOAD_INTERVAL) | |||
} | |||
}, | |||
dataLoading: (dataLoading) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see us cleaning up this when we actually finish loading the data, we just clean it up when we unmount, is this right?
Will do some clean up and add my suggested changes ☝🏻 in my follow-up PR |
Ah sorry about the text sizing! |
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Problem
Users with a lot of data can run into slow insights because they aren't aware of specific things that can make loading slow.
Changes
Shows a list of things specific to that insight that can help with loading times. Only shows this list if the insight takes > 7 seconds to load, and the sampling if only after 12 seconds.
Why 7 and 12? I sat and stared at these for a while and those intervals felt correct.
Screen.Recording.2025-02-13.at.11.44.03.AM.mov
Here are some other screenshots of the different states:
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
Should
How did you test this code?
👀