I can't get to this right now, but Akshay, can we get it in before the release?
I don't think the problem Khushboo notes is really a problem. Waiting for a response before issuing another one seems sensible... as long as there's a timeout so things don't get stuck if a response gets lost somehow. Maybe the timeout should be something like 3x the normal interval?
Attached is the patch to optimise the dashboard. Changes include:
1) One ajax request for the all the charts instead of separate for every chart. The next request will not hit until the previous is completed.
2) The code will check for intervals which is greatest common divisor of all the refresh rates. Chart names which will be eligible for refresh will be sent with the ajax. If none are eligible, no ajax will be fired.
3) In the backend, query is generated in such a way that data for all the requested chart names will be fetched in one hit to the database.
4) Test cases for charts rest api and javascript added.
--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune