Skip to content

Commit

Permalink
temp: add function_trace temporarily to breakdown queryset fetch in p…
Browse files Browse the repository at this point in the history
…athways api (#4274)
  • Loading branch information
DawoudSheraz committed Feb 19, 2024
1 parent 8fddf98 commit 251d161
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions course_discovery/apps/api/v1/views/pathways.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Views for accessing Pathway data """
from edx_django_utils.monitoring import function_trace
from rest_framework import viewsets

from course_discovery.apps.api import serializers
Expand All @@ -10,6 +11,7 @@ class PathwayViewSet(CompressedCacheResponseMixin, viewsets.ReadOnlyModelViewSet
permission_classes = (ReadOnlyByPublisherUser,)
serializer_class = serializers.PathwaySerializer

@function_trace('pathways_api_queryset')
def get_queryset(self):
queryset = self.get_serializer_class().prefetch_queryset(partner=self.request.site.partner)
return queryset.order_by('created')

0 comments on commit 251d161

Please sign in to comment.