-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add worker info in job_next_previous #4990
base: master
Are you sure you want to change the base?
Conversation
76e694a
to
657b37c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make more sense to show the worker's host name and instance number as link text because the ID is rather random. You could also already make the href server-side using the url_for helper of Mojolicious.
I'm also wondering whether the JavaScript code that generates HTML should take care of escaping. We're not doing it for other columns so far but it would be an easy improvement as we generally already have a helper function for this.
That was my original idea, but I still need to figure out how to retrieve the
I will have a look. |
657b37c
to
95d2f2b
Compare
PR updated to use worker name instead of worker id, based on @kalikiana suggested change. (Thanks!) |
@@ -453,6 +453,7 @@ sub job_next_previous_ajax ($self) { | |||
DT_RowId => 'job_result_' . $job_id, | |||
id => $job_id, | |||
name => $job->name, | |||
assigned_worker => $job->assigned_worker->name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested the performance impact? This will do yet another SQL query for every job for this already slow route. The "prefetching" I meant in another comment is basically a join with the workers table when querying jobs. I suppose the "prefetching" needed to be done in
openQA/lib/OpenQA/Schema/ResultSet/Jobs.pm
Line 399 in 9cf9ed8
sub next_previous_jobs_query { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how I could measure the perf impact.
The SQL code has already SELECT *
, so I think it should be pre-fetched already, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it needed a join or a nested query with the workers table to return the associated worker name. However, I'd needed to play around with this myself because using a view is a special case.
For performance testing itself, I usually import a production database locally. This isn't an option for your but you could simply create lots of jobs (that are next/previous ones for an existing job) manually. To measure the response time of web UI routes I usually use a Mojolicious plugin (see https://github.com/Martchus/openQA-helper#profiling).
Note that I'm only concerned about this because this route already takes long anyways (e.g. checkout https://openqa.opensuse.org/tests/3126056#next_previous) and if we'd multiply this time even by a slight factor due to an additional/separate query per job this feature might do more harm than good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the performance impact from #4990 (comment) as well as the user experience I think we are able to come up with a better approach. I understand that sometimes someone would want to know the worker info from next+previous jobs but likely the purpose is "investigation" and we have a separate page for that. I guess in other cases people want to know other, different page in the next+previous page. But putting all of that information in the page from the beginning can be too much. Alternative approaches I suggest to consider:
- Include the information in the "investigation" page instead
- Add a table header or check box with what additional information items to include on request but keeping the page with the information as is as the default
Another alternative: We could include at least a link to the worker's page as the worker ID is available (without doing any further queries or joins). Since the link wouldn't have a meaningful text (just the worker ID) it could be in form of an icon. |
That alternative suggestion sounds good to me. A good compromise UX- and performance wise |
It does not make much sense to have it in I need to investigate how to add a checkbox for this optional column. |
Having an optional column might not be that easy (depending how well DataTables supports that). So maybe just go for an icon-link as suggested in my previous comment. |
Worker ID was my initial submission but this is far less useful than worker name. |
If it is a link to the worker details page of that specific worker it is still an improvement.
We have that table, it is the |
#5043 optimizes the existing next/previous route with prefetching job modules and dependencies. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This PR adds a
Worker
column to know which worker was used.Screenshot: