-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: statistics API #4
Conversation
3d9a001
to
375adc9
Compare
bc6b3af
to
514889a
Compare
22d6afe
to
193dd9c
Compare
193dd9c
to
7daf9dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shadinaif please go ahead and merge this pull request. I wasn't aware it was blocked by review.
) | ||
) | ||
).filter( | ||
Q(courses_count__gt=0) | Q(has_site_login=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this is the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the list of users related to the tenant. So, the user must be enrolled in one of the tenant's courses, or have a site login in the tenant's site
from futurex_openedx_extensions.helpers.tenants import get_course_org_filter_list, get_tenant_site | ||
|
||
|
||
def get_learners_queryset(tenant_ids: List, search_text: str = None) -> QuerySet: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This query is a bit slow on production. Any idea how can we make it faster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the issue is not this particular query. It's the other helper queries, you'll find a few methods with TODO
to add cache. These will increase the performance significantly as far as I can see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if caching didn't fix it, we might need to do something with UserSignupSource
. We need it to record logins, not just signups. So we can use it to directly filter the user by site.
Currently, there are too many records for users with enrollments in a site, but without a record in UserSignupSource
feat: statistics API