Project

General

Profile

action #55112

Load dashboard contents on demand

Added by mkittler 11 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2019-08-05
Due date:
% Done:

0%

Estimated time:
Difficulty:
Duration:

Description

The loading time of the openQA start page is quite slow. This is because accumulating all the displayed build results involves a lot of database access and processing data with Perl code.

An idea to improve this is loading these dashboard contents only on demand. This make sense because for a lot of use cases the start page is just used to navigate to another page or to login. I would add a button to load the dashboard contents via AJAX and also a query parameter to trigger this automatically (so if someone wants to save the click after all one can add a bookmark).

History

#1 Updated by mkittler 11 months ago

I've just did a quick benchmark and the build results are what the main page slows down mostly, indeed. The seconds thing is already the job groups menu bar but compared with the build results this is not significant.

Note that just out-commenting code in the template (like okurz tried to test the performance improvement in production) does not help to see the difference because compute_build_results is nevertheless executed.

#2 Updated by coolo 11 months ago

I disagree with 'on demand' - I consider it a vague theory that people go to that page to jump to the menu. I would on the opposite think people go there to click into the build results.

The problem with the / route is more that it's polled so often by monitoring plugins - we disabled 2/3 of them by now. What would be interesting to know: can we split the calculating of the job groups from the exact job details loaded by AJAX? That would make plugins polling / less problematic, as they wouldn't query the expensive function - offer a quick link to job groups for those navigating, but still offers the dashboard for those needing it.

#3 Updated by okurz 11 months ago

  • Category set to Feature requests

btw, Engineering Infrastructure has moved from / to /tests now in #55691

I thought of loading build results asynchronously but still automatically so that anyone moving on to job groups or /tests or the user menu can already go the next step without needing to wait 30s

coolo wrote:

[…] can we split the calculating of the job groups from the exact job details loaded by AJAX?

you mean making sure to only evaluate the result of each job so that we can compute the bars? I doubt we have anything to optimize in this regard. We also already prefetch comments and such.

#4 Updated by mkittler 11 months ago

  • Category deleted (Feature requests)

can we split the calculating of the job groups from the exact job details loaded by AJAX?

Not exactly sure what you mean. But we can of course simply load the entire contents beyond the branding box via AJAX. That would be like the dashboard on GitHub and technically similar to what I proposed before just without an extra click.

#5 Updated by mkittler 11 months ago

  • Category set to Feature requests

#6 Updated by coolo 11 months ago

  • Priority changed from Normal to Low

#8 Updated by mkittler 9 months ago

  • Status changed from New to In Progress
  • Assignee set to mkittler
  • Target version set to Current Sprint

#9 Updated by mkittler 9 months ago

  • Status changed from In Progress to Resolved
  • Target version changed from Current Sprint to Done

PR has been merged

#10 Updated by okurz 9 months ago

8747

I saw it working in production on o3 however with a tiny problem. When I click on another link while the build results are showing for a short moment a red error box shows up that the build results could not be rendered, as the request was canceled by wanting to go to another target in the meantime. See Screenshot_20191001_084128.png

To reproduce: Go to https://openqa.opensuse.org/ , while the page loads, click on "All tests", observe the error message before the browser switches to /tests. I suggest to handle that request cancel gracefully, e.g. do not show the error when a request for another page is pending. Not sure if this needs all to be handled in javascript, I assume so.

#11 Updated by okurz 9 months ago

fvogt mentioned another problem. The text with relative time, e.g. "3 days ago" disappeared. It just shows the timestamp, not nicely formatted.

#12 Updated by mkittler 9 months ago

  • Status changed from Feedback to Resolved

PR fixing these issues has been merged: https://github.com/os-autoinst/openQA/pull/2366

Also available in: Atom PDF