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

Scroll depth: update site.scroll_depth_visible_at in ingestion #5035

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

macobo
Copy link
Contributor

@macobo macobo commented Jan 30, 2025

We decide what metrics to show dynamically based on whether site has sent us scroll depth data.

Previously, this data was queried dynamically from ClickHouse on page loads, but this approach adds 50-200ms to every page load until a site has sent us scroll depth data.

Instead, we now update site.scroll_depth_visible_at in ingestion. To limit impact on ingestion:

  1. scroll_depth_visible_at is now cached along with other ingestion site data.
  2. updates are processed using ets, making sure only one database update is ever done per site
  3. handles errors gracefully if postgres is ever in e.g. read-only mode or otherwise unavailable.

I'm curious whether I'm taking a sane approach with the GenServer here. cc @zoldar for feedback on that front.

@macobo macobo requested a review from RobertJoonas January 30, 2025 13:29
@macobo macobo force-pushed the genserver-update-scroll-depth-visibility branch from 9bce221 to 37eae52 Compare January 30, 2025 13:31
Copy link
Contributor

@zoldar zoldar left a comment

Choose a reason for hiding this comment

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

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