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

Issue 515 slow loading of asset page due to timerange query of its sensors #533

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Nov 15, 2022

This PR makes data load faster on the asset (and sensor) page. Most commonly, the time range is already set as session data, so we shouldn't have to wait for finishing a potentially slow query to the database that determines the full timerange of shown sensors.

Also, the date range selection on the calendar is now set much earlier, when initializing the calendar, instead of when the charts are done loading. This means that, when you navigate the calendar while charts are still loading, you don't annoyingly pop back to the initial selection when the charts are done loading.

Closes #515.

… and only use the timerange of shown sensors to set the date range if the date range isn't set by session variables already; minYear and maxYear are already set asynchronously after fetching the timerange

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added the UI label Nov 15, 2022
@Flix6x Flix6x self-assigned this Nov 15, 2022
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added this to the 0.12.0 milestone Nov 15, 2022
@Flix6x Flix6x marked this pull request as ready for review November 15, 2022 13:04
@Flix6x Flix6x requested a review from nhoening November 15, 2022 13:05
@coveralls
Copy link
Collaborator

coveralls commented Nov 15, 2022

Pull Request Test Coverage Report for Build 3470680784

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 64.967%

Totals Coverage Status
Change from base Build 3444928999: 0.0%
Covered Lines: 6570
Relevant Lines: 9491

💛 - Coveralls

Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! I tested it on my demo and I believe it makes it a bit better :)

@Flix6x Flix6x merged commit 81b6525 into main Dec 1, 2022
@Flix6x Flix6x deleted the issue-515_Slow_loading_of_asset_page_due_to_timerange_query_of_its_sensors branch December 1, 2022 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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