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

API Responses page in built-in Telemetry UI is not responding with ~1000 endpoints #139

Closed
hieuxlu opened this issue Jun 10, 2021 · 11 comments
Assignees
Labels

Comments

@hieuxlu
Copy link

hieuxlu commented Jun 10, 2021

My web application has around 80 1000 endpoints, so the API Responses page is unresponsive because of too many charts, making the page unusable.

What would be the best way to address this issue in Swagger Stats UI. Something that comes in my mind:

  • Pagination for API Responses charts
  • Virtualization, virtual scroll
  • Divide into multiple routes/pages for each endpoint, just like API Operations

I would like to discuss if we want to fix this. I am able to contribute to fixing this with a PR, once we agreed on the solution.

@sv2 sv2 self-assigned this Jun 10, 2021
@sv2 sv2 added the bug label Jun 10, 2021
@sv2
Copy link
Collaborator

sv2 commented Jun 10, 2021

Thanks ! Can you share your /stats API response with data for that page, so I can use it to reproduce ? I will try to simulate as well

@hieuxlu hieuxlu changed the title API Responses page is not responding with ~80 endpoints API Responses page is not responding with ~80~ 1000 endpoints Jun 10, 2021
@hieuxlu hieuxlu changed the title API Responses page is not responding with ~80~ 1000 endpoints API Responses page is not responding with ~1000 endpoints Jun 10, 2021
@hieuxlu
Copy link
Author

hieuxlu commented Jun 10, 2021

Sorry, I took a closer look and it turns out there were 1000 different endpoints. I was mistaken with number of express route files (~100), each of which might have ~10 endpoints. So in total there were ~1000 individual end points.

Do you think swagger-stats's built-in Telemetry UX could some how still works in this cases, or could we some how improve API Responses page for such use-cases?

I created this minimal repo with ~1000 generated endpoints to reproduce
https://github.com/hieuxlu/swagget-stats-1000-endpoints

@hieuxlu hieuxlu changed the title API Responses page is not responding with ~1000 endpoints API Responses page in built-in Telemetry UI is not responding with ~1000 endpoints Jun 10, 2021
@sv2
Copy link
Collaborator

sv2 commented Jun 11, 2021

Thank you! Will review

@hieuxlu
Copy link
Author

hieuxlu commented Jun 25, 2021

@sv2 Is there any update from your end? I could help creating a PR if we agree on a solution. I personally perfer simple pagination (.e.g <= 20,50,100 APIs/page) to reduce the cost of chart rendering first. Does that sound good to you?

@sv2
Copy link
Collaborator

sv2 commented Jun 26, 2021

Good progress - now looks much more responsive with 1000 api endpoints:
slanatech/swagger-stats-ux@3044258

Perhaps you can try building with latest UX package to validate from your side ?
will release this update shortly

@hieuxlu
Copy link
Author

hieuxlu commented Jun 27, 2021

@sv2 Nothing seems to change on my side. I built the new ux, replaced the old one in node_modules/swagger-stats/ux, double checked to verify it's using the new file hashes, which it did. However, the page is still not responding for ~5 minutes.

I would not blame the code or the library. There's simply too many charts. And no one would look at 1000 charts at the same time, so why do we bother rendering all of them?

@sv2
Copy link
Collaborator

sv2 commented Jun 27, 2021

Right, the change is exactly that - to render only charts that are currently visible. Let me do a bit more testing.

@sv2
Copy link
Collaborator

sv2 commented Jun 27, 2021

Made several corrections - please try with swagger-stats-ux 0.95.29
https://www.npmjs.com/package/swagger-stats-ux/v/0.95.29

@hieuxlu
Copy link
Author

hieuxlu commented Jun 28, 2021

Thank you, the loading placeholder solved the issue, although we'll need to update ux directory in swagger-stats npm package as well. Will close the issue now.

@hieuxlu hieuxlu closed this as completed Jun 28, 2021
@sv2
Copy link
Collaborator

sv2 commented Jun 28, 2021

Great! Will release swagger-stats version with updated ux shortly

@sv2
Copy link
Collaborator

sv2 commented Jul 2, 2021

swagger-stats v0.99.2 with this fix released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants