Repository navigation
Add period selection and engagement totals to the data overview - #8
Open
bluebird42 wants to merge 1 commit into
Open
bluebird42 wants to merge 1 commit into
bluebird42 wants to merge 1 commit into
Conversation
The overview now covers 24 hours, 7 days, 30 days or 12 months instead of fixed today/month/year counts. Views, watch time, average watch time per view and average completion are compared with the period before, and a chart shows views and watch time per hour, day or month. Device and browser breakdowns follow the selected period. A view is one playback session of one video with at least one second watched; times are in UTC. The public space data API is unchanged. 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.
The data page showed three fixed view counts (today, this month, this year) and a bar per month, so there was no way to look at the last week, compare with an earlier period, or see how long people actually watched.
The overview now has a period switch for the last 24 hours, 7 days, 30 days or 12 months (default 30 days, kept in the URL as
?period=). For the chosen period it shows:A view is one playback session of one video with at least one second watched, the same threshold as before. Completion is the furthest point reached divided by the video's duration. Times are in UTC. The queries live in the new
MaveCore.Analytics.Overviewand read the existingeventstable; the public space data API (Analytics.space_data/1) is unchanged.video_metric_cardgains an optionalunitand comparison line; the video page keeps its current look, and storybook has an example.Stacked on #7.
Last 30 days, compared with the 30 days before (synthetic data):
Last 12 months, per month:
Validation:
Analytics.Overviewtests cover the period windows, views, watch time, completion, the previous period and the one-second threshold against ClickHouse.mix compile --warnings-as-errors,mix format --check-formatted, Credo andgit diff --checkpassed.StoragePolicyTestand fail identically onmainin my local setup (storage reached throughhost.docker.internal); they are unrelated.No migration is needed.