Skip to content

Conversation

strig
Copy link

@strig strig commented Feb 18, 2023

When profiling requests with a huge number of queries sometimes we end up with multiple pages. Since the sql page only sorts current lines it's hard to see all the heaviest queries on one page and there's no way to see more than 200 since the limit is hardcoded.

This will allow the user to specify a page size via URL param e.g. &per_page=300.

When profiling requests with a huge number of queries sometimes we end up with multiple pages. This will allow the user to specify a page size via URL params.

def _page(request, query_set):
paginator = Paginator(query_set, 200)
per_page = request.GET.get('per_page', 200)
Copy link
Member

Choose a reason for hiding this comment

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

let's make sure this is actually an int, especially because the input is coming from an external source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants