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

Enhancement: Update User Activity Query #35

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/20240405_151230_fahad.khalid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Improvement] Update User Activity dataset query by extending time span to 120 seconds and selecting all events where course ID is not null to improve average time spent in course. (by @Fahadkhalid210)
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@
"offset": 0,
"params": "{\"remote_id\": 49, \"database_name\": \"admin\"}",
"schema": "openedx",
"sql": "SELECT user_id,\n course_id,\n time,\n arrayJoin(range(floor(toUInt64(toUnixTimestamp(time) - 5)), ceil(toUInt64(toUnixTimestamp(time) + 5)))) AS timestamp\nFROM events\nWHERE event_source = 'browser'",
"sql": "SELECT user_id,\n course_id,\n time,\n arrayJoin(range(floor(toUInt64(toUnixTimestamp(time))), ceil(toUInt64(toUnixTimestamp(time) + 120)))) AS timestamp\nFROM events\nWHERE course_id <> '' and user_id > 0",
Copy link
Contributor

Choose a reason for hiding this comment

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

So we are ignoring browser entirely in this new query? Why is that? The timestamp change is understandable.
Also, if we can add some visualizations (before/after), it would make it easier to understand the impact.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are now picking both events(browser and server) where we have course_id and user_id because some events have source "server"(e.g edx.grades.problem.submitted) which we missed previously.

"table_name": "User activity",
"template_params": null
}
Expand Down
Loading