flexmeasures icon indicating copy to clipboard operation
flexmeasures copied to clipboard

Slow loading of asset page due to timerange query of its sensors

Open Flix6x opened this issue 1 year ago • 0 comments

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

Flix6x avatar Oct 13 '22 14:10 Flix6x