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

Fix Pagination Breaking visits analytics page #103

Closed
acelaya opened this issue Feb 8, 2019 · 2 comments
Closed

Fix Pagination Breaking visits analytics page #103

acelaya opened this issue Feb 8, 2019 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@acelaya
Copy link
Member

acelaya commented Feb 8, 2019

Originally reported in shlinkio/shlink#349

Ever since pagination was implemented into the panel I can no longer open links with large amounts of visits (anywhere from 30-100K visits).

The page will load for a while and then will eventually freeze the tab, and will require a task manager kill to be able to close chrome. I've also tried letting it sit for an extended period of time. After about 5 minutes it would go back to the main shlink control panel screen where you select a server.

Here is an image of console/network activity when trying to load one of these link analytics.

https://i.imgur.com/rKckDbv.png

@acelaya acelaya added the bug Something isn't working label Feb 8, 2019
@acelaya acelaya added this to the 2.1.0 milestone Mar 3, 2019
@acelaya acelaya self-assigned this Mar 3, 2019
@acelaya acelaya modified the milestones: 2.1.0, 2.0.2 Mar 3, 2019
@acelaya
Copy link
Member Author

acelaya commented Mar 4, 2019

@tivyhosting I have managed to reproduce the issue, and it is due to the fact that every time a change in the UI happens, all the stats are recalculated from the huge dataset (and React was considering a lot of things as "changes in the UI", like just clicking anywhere), which makes the UI freeze until it finishes.

I have found a solution which consists on memoizing the result of that calculation based on the filtering arguments (short code and dates).

I also plan to make the stats from all graphics to be calculated in just one iteration (it is now performing one iteration each).

It still takes quite some time to load the entire dataset (about 2min for 100k results, but I suppose this value tightly depends on the server performance and network latency).

One way to improve this could be parallelizing requests. Maybe in blocks of 4 (browsers never do more than 6 requests at a time).

I'll let you know how it goes once I have applied all the improvements.

@acelaya
Copy link
Member Author

acelaya commented Mar 4, 2019

@tivyhosting I have just published and deployed v2.0.2 which fixes this issue.

The page should no longer freeze after loading all visits, and it should take a little bit less to load (still, probably a bit).

Please let me know if you find anything new.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant