Nightly traffic digest, on by default - #242
Merged
Merged
Conversation
The performance report already had weekly and monthly cadences, an hourly TZ-aware cron and a settings control. This adds 'daily' to that rather than a second mechanism beside it. What the nightly one is for is traffic, so the report gains a traffic section and the email leads with it: overall humans and bots first, then every property most to least busy, with each one's bot share. The subject carries the human count, because that is the number worth seeing on a phone. Counting is by tracker bucket — a bucket starting 'bot:' is a crawler and everything else is a human, AI referrals included. That split only exists on tracker_daily_stats; tracker_event_daily_stats has no bucket column and its pageview counts include crawlers. The migration makes 'daily' the column default so a new account gets the digest without hunting for the setting. Existing rows keep whatever their owner chose: a default applies to inserts, and moving somebody from weekly to nightly would be changing a preference, not honouring one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WYMJH7N4d2qRct5Q5q2YWQ
ThreatCrush Security Scan39 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 28 | LOW: 9
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
The performance report already had weekly and monthly cadences, an hourly TZ-aware cron and a settings control. This adds
dailyto that rather than a second mechanism beside it.What the nightly one is for is traffic, so the report gains a traffic section and the email leads with it: overall humans and bots first, then every property most to least busy with each one's bot share. The subject carries the human count, because that is the number worth seeing on a phone.
Counting is by tracker bucket — a bucket starting
bot:is a crawler, everything else is a human, AI referrals included. That split only exists ontracker_daily_stats;tracker_event_daily_statshas no bucket column and its pageview counts include crawlers.The migration makes
dailythe column default so a new account gets the digest without hunting for the setting. Existing rows keep whatever their owner chose: a default applies to inserts, and moving somebody from weekly to nightly would be changing a preference rather than honouring one.Verified:
tsc --noEmitclean; 2,136 tests pass, 11 of them new covering the daily due-check (including timezone and same-day dedupe), the ordering, and the empty case.🤖 Generated with Claude Code
https://claude.ai/code/session_01WYMJH7N4d2qRct5Q5q2YWQ