-
Notifications
You must be signed in to change notification settings - Fork 462
backend: cmd/pagination: add pagination API for getting limited resource size #3766
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: upsaurav12 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
dffbf5a to
df35553
Compare
response size this helps to get only limited number of resources that the users want to access not just fetching full resource. and then set continueToken in the proxy URL.
This adds a new Pagination Middleware that will help to fetch multiple pages once for example page 1 to page 5.
page that was requested from the client. This improves the pagination functionality, which help to return only page that was requested from the client not the full list, this help the frontend to fetch only page that the user wants to see the page not the full list. Currently the page size is limit =15, we can make it dynamic according to the headlamp.
74aa0fc to
86baed2
Compare
|
@illume @yolossn I am trying to implement the pagination part but here the problem is the it is somehow still taking 800ms or even 1s taking from the backend server. I checked in postman it is giving response time like 10ms etc. Here in this code i am adding query that will go to backend server which results adding I think i need to manage the pageState in such a way that it should send pageNo to backend when the user is going to next or prev page |
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |

This add new pagination API which would help to send only request that the user is veiwing only not just full resource list.
How To Test.
Currently this functionality is not integrated with the frontend of Headlamp but still we can see the pagination works easily if we have tools like POSTMAN or ThunderClient (VS Code Extension).
localhost:4466/clusters/{your-cluster-name}/api/v1/{your-desired-resource}?pageNo=<page-you-want-to-go>.load-testsand create 1000's of pods and nodes, there you can see that the client is downloading the resource page of that page with size of ~2KB, and with the current setup it is downloading 100KB.here is my current implementation for pagination, i am currently figuring out how i am going to integrate this with frontend so that we can see the actual change due to pagination.