flexmeasures
flexmeasures copied to clipboard
Slow loading of asset page due to timerange query of its sensors
The timerange of sensor data shown on the asset page can take some time to load, especially if showing many sensors that have a lot of data. In most cases, the information is only used to set the minYear and maxYear of the datepicker's dropdown menu, because the timerange of the loaded data is more commonly taken from the session. Only in case of a fresh session, the end of the timerange is also used to initialize the picker to the last 2 days of available sensor data.
It would be better to query the timerange asynchronously, updating the dropdown when the information has been fetched.
Relevant parts of the code:
-
api/dev/sensors.py
-
ui/templates/base.html