Add per-page time-consumption statistics to flow analytics#1495
Draft
Add per-page time-consumption statistics to flow analytics#1495
Conversation
Agent-Logs-Url: https://github.com/inducer/relate/sessions/be6291a6-07c2-4d53-b712-44e571e24cae Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/inducer/relate/sessions/be6291a6-07c2-4d53-b712-44e571e24cae Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
…ment typo Agent-Logs-Url: https://github.com/inducer/relate/sessions/be6291a6-07c2-4d53-b712-44e571e24cae Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
…ation filter Agent-Logs-Url: https://github.com/inducer/relate/sessions/be6291a6-07c2-4d53-b712-44e571e24cae Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
…oach; fix stddev avg consistency Agent-Logs-Url: https://github.com/inducer/relate/sessions/be6291a6-07c2-4d53-b712-44e571e24cae Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add flow analytics for time-consuming problems
Add per-page time-consumption statistics to flow analytics
May 3, 2026
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.
Flow analytics lacked visibility into which pages take the most student time. This adds per-page timing statistics derived from the gap between a page's last no-answer visit and its submitted-answer visit, with a toggle to include all sessions or only those counted in grade statistics (letting instructors distinguish TA time from student time).
Backend (
course/analytics.py)PageTimingStatsdataclass:group_id,page_id,count,avg_time,min_time,max_time,stddev_time(minutes)make_page_timing_stats_list(pctx, flow_id, include_all_sessions):ExpressionWrapper(DurationField)annotates elapsed time; negative durations filtered at DB level (clock-skew guard)Count/Avg/Min/Maxpushed to the DB via Django aggregation; sample stddev computed in Python (SQLite lacksSTDDEV)include_all_sessions=Falserestricts to participants withincluded_in_grade_statisticsflow_analyticsview accepts newtiming_include_all_sessionsGET param; passespage_timing_stats_listto templateTemplate (
analytics-flow.html)Tests
FlowAnalyticsTestmock-based tests updated to also patchmake_page_timing_stats_listMakePageTimingStatsListTest: empty result, no preceding view, basic stats, multi-visit math, sort order, session-filter correctness (asserts specific counts for student vs. TA participation)