action #25766
closed[tools][sprint 201712.1][bonus] Displaying all Worker status by calling Websocket DBus service in the WebUI list is overkill
0%
Description
When browsing the WebUI, clicking on "Workers" to get the list triggers an extensive loop call over websocket dbus service, that is performed over all the workers just to check if they are connected and display the result to the user.
This operation is potentially overkill when dealing with large number of workers, since each view of that page, triggers a dbus call for each worker, that yields generally to a O(N*M) complexity where M are the users hitting the page in the same moment and N are the registered workers, without taking in consideration the dbus call dispatch timings.
I think instead we should retrieve the same information in the DB, since it is already holding the necessary information to determine if a worker is up or down.
For reference, the method that is being called is 'connected' in the Worker schema [1] called by 'info' [2] that gets propagated from [3][4]
- https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Schema/Result/Workers.pm#L157
- https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Schema/Result/Workers.pm#L190
- https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/WebAPI/Controller/Admin/Workers.pm#L25
- https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/WebAPI/Controller/Admin/Workers.pm#L38