Closed alexfinnarn closed 5 years ago
So...these are in the reverse chronological order that I would expect. The problem is that Atlas is slow to pull up individual stats records and so building an aggregate of all the versions takes way too long, especially on the prod environment.
I looked a little more into this, and it's not worth investing time into it unless there are ways to query stats that I don't know about.
My first thought was to take the total number of versions, which is listed on the statistics/<id>
overview page, divide by the paging number of 100, and then ask for the pages in a reverse order only taking in so many pages based on a variable in the settings. To make it useful, that would require hundreds of requests to equal one call now.
When you go the ?version=all&page=2
route, those can take up to 20+ seconds for a response. I looked at Webcentral on prod and it has 1841 stats versions ATM. If the site in question has many fewer versions, then the lookup is faster, but a lot of sites on prod have 2000 or so versions of stats.
I bet the amount of records in Atlas affects a whole lot of things, but I thought pulling up documents of each stats record would be much faster than this.
Closing due to no time to fix and ideally Atlas would make changes to help...the feature does still work with fewer stats records per site.
The stats records go from when the site was created so usually you want to start off looking at fresh records. Currently, I think you see old records and getting to the new ones can be a challenge or impossible.