Repository navigation
feat: a website's posts on Insights, their views kept a month at a time (ADR 0069) - #61
Merged
Merged
Conversation
…me (ADR 0069)
Insights shows how many posts a website's sitemap lists, the ten newest with how often each was
read, the most read ever, and a calendar of the last twelve months of posting.
- ClickHouse migration 0015 adds consolidated_post_months: one row per website per finished month,
each read post's path with its pages delivered to everybody and to people, no TTL, removed with
the website. It widens the retention envelope, stated in full in ADR 0069.
- A post's views are the dashboard's list-of-pages arithmetic, asked as one statement per question:
the store returns every delivered path of the window and the engine keeps the posts', so no post
path is ever part of a statement or a bound value.
- The background service that keeps months keeps each month's posts in a pass of its own, counted
again on the month's own terms and when the list of posts changes (after an hour), never deleting
anything; a failing post pass leaves the month totals kept.
- GET /api/sites/{id}/insights/posts reads kept months before the first month answered from its
reports, and the reports from there on, so a post's views are never behind the record.
- A post is credited with the path a same-site redirect landed on, unless that path is another
listed post's own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 5 of the Insights plan: a website's posts on Insights. Recorded in ADR 0069.
0015_posts_read_month_by_monthaddsconsolidated_post_months: per website and finished month, each read post's path with pages delivered to everybody and to people. It has no TTL and is purged with the website. This widens the retention envelope; ADR 0069 states it in full.MonthlyConsolidationgains a post pass of its own, run after the month totals. It followsMonthsToCount's rule held toCountingRules.Posts, plus a recount one hour after the list of posts changes (fingerprint). It deletes nothing, and a post failure leaves the totals kept.GET /api/sites/{id}/insights/posts[?only=people]uses kept post months before the first month answered from its reports, and the reports from there to now. The population is checked before the website is resolved, and unknown and forbidden websites are answered identically. A website with no posts is answered without asking the telemetry store.Tests
pnpm verify: web 2,226, tracker 84, edition 124 and site 78.🤖 Generated with Claude Code